Solution to ajax aborted request interruption in IE6

Source: Internet
Author: User

A click event is bound to tag a to trigger ajax requests. In IE6, requests are often interrupted and everything works in other browsers.

In IE6, when Fiddler2 and httpWatch are used to monitor requests, "aborted" is often displayed, which is quite strange after a long time. Later, the tag is changed to a button, and the request is normal. Finally, it is reminded that the default event of a tag may have interrupted the request. However, in HTML code, the href of tag a has been set to "javascript: void (0)", which usually blocks the default event (page Jump ). The click event of the tag is executed first before the href jump is executed. If href is a javascript statement, it is executed at this time. IE6 interrupts the ajax request triggered by click when executing the href javascript statement. Use href = "javascript: void (0)" to prevent default events. Move the actions that prevent default events to the click event to solve the problem, in this way, the javascript statement in href will not be executed.

Note: Adding onclick = 'Return false; 'to acan also solve the problem.

Related Article

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.