开发者

IE8 Browser JavaScript issue

开发者 https://www.devze.com 2023-04-02 16:39 出处:网络
Can anyone tell me the reason why the following works in IE8 but not in Safari 5.1? <a onclick=\"j开发者_如何学运维avascript:submit();\"><img src=\"Images/Next.png\" width=\"20\" height=\"20

Can anyone tell me the reason why the following works in IE8 but not in Safari 5.1?

<a onclick="j开发者_如何学运维avascript:submit();"><img src="Images/Next.png" width="20" height="20"></a>

JavaScript is enabled in both IE8 and Safari 5.1.


Try dropping the 'javascript:' from the onclick. The only time I see this syntax used is when it is in the href. The content of onclick is assumed to be JavaScript by default. As such,

javascript:submit();

Is not valid JavaScript.

0

精彩评论

暂无评论...
验证码 换一张
取 消