The following content is a post:
Code
Copy codeThe Code is as follows: <script type = "text/javascript">
Function goUrl (x)
{
Window. location. href = x;
}
</Script>
<A href = "javascript:;" onclick = "javascript: goUrl ('HTTP: // www.baidu.com ');"> jump 1 </a>
<A href = "javascript: void (0);" onclick = "javascript: goUrl ('HTTP: // www.jb51.net ');"> jump 2 </a>
<A href = "javascript: void (0);" onclick = "javascript: goUrl ('HTTP: // s.jb51.net '); return false;"> jump 3 </a>
<A href = "#" onclick = "javascript: goUrl ('HTTP: // adm.baidu.com ');"> jump to 4 </a>
<A href = "###" onclick = "javascript: goUrl ('HTTP: // tools.jb51.net');"> jump to 5 </a>
Test Environment IE6, IE7, and Firefox 3.
The redirection 1 and 2 are invalid in IE6, and both 3, 4, and 5 pass the tests in IE6, IE7, and Firefox3.01 ,.
Jump to 4 and 5 is the most concise.
The key lies in the href attribute of <a>. For empty links, use "#","###".
In order not to return to the top of the page.
"####" Is recommended for empty links "###".
I used the third method, and added return false to the end. In this way, IE6, IE7, and FF3 all passed.