Home > Web Front-end > JS Tutorial > Location.href statement is incompatible with Firefox_javascript tips

Location.href statement is incompatible with Firefox_javascript tips

WBOY
Release: 2016-05-16 18:23:59
Original
1250 people have browsed it

A js is used to jump by clicking the button. The statement is very simple:



During testing, it was found that it can be used in IE but not in firefox. So I added a window in front of the location, that is, changed it to:

onclick="window.location.href('http://baidu.com');"

I found that it still didn’t work. .

So I went to Baidu and found an answer:

Use window.location="url"; instead of location.href('url');"

So I changed the source The program can be changed as follows:


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template