Ajax page without refreshing IE encountered Ajax cache caused by the problem of data not updating _jquery
Source: Internet
Author: User
In doing Ajax pages without refreshing add, ie encounter ajax cache, because the beginning does not know IE has this bad, toss for a long time, finally solve the problem.
summarize the solution :
Using AJAX to request a page under IE, usually because of the cache to return the last results, causing confusion, [that is, get the data, because the sending parameters and addresses are consistent, so IE browser will be taken from the cache, and will not go to the server side, and the post method because of the different parameters, This problem will not occur] and this is not the case in FF. To not be affected by caching, you can do this:
IE Access Policy :
Internet Options--browsing history--setting--The Internet temporary files option changes to every time you visit a Web page
1: After the Ajax requested page, add a random function, we can use the random time function
After the URL is sent by JavaScript, add
1 T=math.random ()
For example this :
1 url+ "&" + "t=" +math.random ();//or New Date ();
Add www.hake.cc after URL parameter
1 "? timestamp=" + New Date (). GetTime ();
the best way :
1 $.ajaxsetup ({cache:false})
This is done for all AJAX requests in the page. You don't have to change the N interfaces that have been completed
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.