The ajax page is not refreshed. The Ajax cache causes the data not to be updated.

Source: Internet
Author: User

When I did not refresh the ajax page, I encountered Ajax cache in IE, because I didn't know this bad problem at the beginning. I had to wait for a long time and finally solved the problem.

Summary Solution:
When Ajax is used in IE to request a page, the previous result is usually returned due to cache, resulting in confusion. [get data, because the sending parameters and addresses are the same, the IE browser will retrieve them from the cache and will not request the server. The post method varies with the parameters, this problem does not occur] but does not occur in FF. To avoid cache impact, you can do this:

Internet Explorer Access Policy:
Internet Options -- browsing history -- settings -- the option of Temporary Internet Files is changed to the option that can be used to access the webpage each time.
1: Add a random function after the page of the AJAX request. We can use the random time function.

Add
1 t = Math. random ()

For example:
1 URL + "&" + "t =" + Math. random (); // or new Date ();

Add www. hake. cc to the URL parameter
1 "? Timestamp = "+ new Date (). getTime ();

Best Method:
1 $. ajaxSetup ({cache: false })
In this way, all ajax requests on the page are executed. You don't have to change the N interfaces that have been completed.

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.