Home >Web Front-end >JS Tutorial >Only link A in Firefox cannot simulate a click to trigger its default behavior_javascript tips

Only link A in Firefox cannot simulate a click to trigger its default behavior_javascript tips

WBOY
WBOYOriginal
2016-05-16 18:04:141222browse

The standard event triggering can use the dispatchEvent method. But now FF5 cannot trigger A's default behavior. As follows

Copy code The code is as follows:


< html>


Firefox5 link A cannot simulate click bug

Sina Mailbox



Link A, use dispatchEvent to simulate a click. The test jumps to mail.sina.com.cn in IE9/Safari/Chrome/Opera. Only Firefox5 did not jump over.
Since the click method is added to all elements in Firefox 5 (Firefox 3 does not), use the click method to test
Copy the code The code is as follows:

Sina Mailbox
< script>
var a1 = document.getElementById('a1');
a1.click();


The test still did not jump to mail. sina.com.cn.
It can be seen that neither of the two methods in Firefox can trigger the default behavior of link A. It may be that the Firefox security mechanism prohibits client programmers from simulating A jump, uh...
Note: The test results of Tapir using FF3 are the same as those of FF5. grateful..
Statement:
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