The <A> label is often used in development to replace the button. The advantage is that the: hover style can be used for the Mouseover effect, but the followingCodeIn IE6, the request in onclick is aborted.
<A href = "javascript: void (0);" onclick = "$ ('current '). src = 'images/001.jpg '; "> switch images </a>. IE6 images are not displayed.
<A href = "javascript: void (0);" onclick = "myjrjrelation. checkattention ();"> follow this person </a>. The request fails in IE6.
When you click a link, The onclick event is triggered first and then href is executed. The void (0) Here terminates the onclick request. This Bugs has been fixed in IE7.
Solution:
1. Do not use onclick, but ensure that the processing function does not return values. Otherwise, the browser will clear the page and only display the function results. If checkattention returns false, the browser displays false.
<A href = "javascript: myjrjrelation. checkattention ();"> follow this person </a>
<A href = "javascript: void (myjrjrelation. checkattention ();"> follow this person </a>Void returns undefined;
2. Add return false to onclick to prevent the browser from executing href. The href attribute is required. Otherwise, the link style becomes invalid.
<A href = "javascript: void (0);" onclick = "myj1_relation. checkattention ();Return false; "> Follow this person </a>
To sum up<A href = "javascript: void (0);" onclick = "myjrjrelation. checkattention (); Return false;">The best compatibility.