按钮的JavaScript适用于IE浏览器,但不是Firefox的window.navigate() [英] button javascript works on IE but not firefox window.navigate()

查看:54
本文介绍了按钮的JavaScript适用于IE浏览器,但不是Firefox的window.navigate()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < input type =buttonvalue =返回onClick =window.navigate('http://www.google.com')> 

这适用于IE8,但不适用于Firefox或Opera。任何人都知道为什么以及如何解决它? 解决方案

如果您选中该方法的文档,您将看到相当常见的:



没有适用于此方法的公共标准。



这意味着这是一个非标准功能,很可能

这将起作用: ; input type =buttonvalue =Backonclick =window.location.href ='http://www.google.com';>

如果您使用的是XHTML:

 < input type =buttonvalue =Backonclick =window.location.href ='http://www.google.com'; /> 


<input type="button" value="Back" onClick="window.navigate('http://www.google.com')">

This works on IE8, but not firefox or opera. Anyone know why and how to fix it?

解决方案

If you check the documentation for that method, you will see the quite common:

There is no public standard that applies to this method.

This means that it's a non-standard feature that most likely only works in Internet Explorer.

This will work:

<input type="button" value="Back" onclick="window.location.href='http://www.google.com';">

If you are using XHTML:

<input type="button" value="Back" onclick="window.location.href='http://www.google.com';" />

这篇关于按钮的JavaScript适用于IE浏览器,但不是Firefox的window.navigate()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆