[Problem description]
Windows. Location. href stops working under IE6
[Solution] 1. <a href => label view code
1 <SCRIPT type = "text/JavaScript"> function gourl (x) {window. location. href = x ;}</SCRIPT> <a href = "javascript:;" onclick = "javascript: gourl ('HTTP: // www.sina.com '); "> jump 1 </a> <a href =" javascript: void (0); "onclick =" javascript: gourl ('HTTP: // www.sina.com '); "> jump 2 </a> <a href =" javascript: void (0); "onclick =" javascript: gourl ('HTTP: // www.sina.com '); Return false; "> jump 3 </a> <a href =" # "onclick =" javascript: gourl ('HTTP: // www.sina.com '); "> jump to 4 </a> <a href =" ### "onclick =" javascript: gourl ('HTTP: // www.sina.com '); "> jump 5 </a>
Test Environment IE6, IE7, and Firefox 3.
Redirection 1 and 2 are invalid in IE6 environment, and can be tested in IE6, IE7, and firefox3.01 in 3, 4, and 5.
Yes ,.
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 "###".
2. Direct window. Location. href = "1.html" view code
1. test environment IE6, IE7, and Firefox 3. 2 jump 1 and 2 are invalid in IE6 environment, and 3, 4, and 5 can pass the test in IE6, IE7, and firefox3.01 ,. 3 jump 4 and 5 are the most concise. 4. The key lies in the href attribute of <A>. For empty links, use "#","###". 5. In order not to return to the top of the page. 6. "###" is recommended for empty links "###". 7 8 2. Direct window. Location. href = "1.html"