IE8 Browser JavaScript issue
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.
精彩评论