Javascript changes to the IMG label SRC not displayed in IE6 [end-to-end method]

Source: Internet
Author: User

This bug left me around for nearly half an hour, and finally Google was successful because of the underlying bug in IE6. When we changed the href attribute of <A>, loading was interrupted, so we could not see the image, this is often encountered when the verification code or dynamic image change.

Therefore, when using a link, href and onclick are usually used at the same time. The onclick event of the link is executed first, followed by the action under the href attribute (page Jump, or Javascript pseudo link ), assume that href and onclick exist simultaneously in the link. If you want to disable the action under the href attribute, onclick must get a return value of false.

Therefore, the solution is to give onclick a false value to ignore the href attribute.

For example:

 

<A href = "javascript:;" onclick = "change image (); Return false;"> click to change image </a>

 

-----------------------------------------------

The above is extracted from the network, but even so, the problem still persists. In the end, there is no way to change a to span.

<Span onclick = "change image ();" style = "cursor: Hand"> </span>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.