Problem: When the verification code is displayed in the login box, an operation is usually performed. Click "a" to display the verification code. The approximate structure is as follows:
< IMG ID = "Img1" /> < A ID = "A1" Href = "Javascript: void (0 )" > Click Show Verification Code </ A > < Script > A1.onclick = Function (){ // Click A1, request the Verification Code address, and display Img1.src = ' Http ://....... ' ;} </ Script >
If yourCodeIn IE6, the request will fail.
Why? Unknown. However, we can conclude that this is the question of this article. If you add an event function to tag a, the HTTP request in the event function fails.
Solution. Block default events.
< IMG ID = "Img1" /> < A ID = "A1" Href = "Javascript: void (0 )" > Click Show Verification Code </ A > < Script > A1.onclick = Function (){ // 1 event. returnvalue = false; Img1.src = ' Http ://....... ' ; // 2 Return false; } </ Script >
You can solve this problem in any of the above annotations.
I guess the cause is that it is estimated that the redirection event of default A is not blocked, and IE6 thinks it is necessary to jump to the page. At this time, requests in the page are blocked.
Summary:
Add return false to the end of an event to a later;