Today, to modify a bug, using AJAX query data, Google Browser can get the latest data, and in IE to get the old data, can not get the latest data, after the search data, only to discover when IE cache mischief.
Found this Ajax request using the Get method, each request URL is exactly the same, IE browser has a special place, if each request of the same URL, will take out the cache already in the data displayed on the page, and will not go to query the database again, so each display is the old data.
Solution:
Then there are ideas, we can make it each request URL is not the same, you can add a parameter, and the value of this parameter each time is different, the time stamp is the best.
Copy Code code as follows:
URL: ' {0}/portal/articlemanager/getcontents?id={1}&date={2} '. Format (Window.baseurl, $ ("#id"). Val (), new Date () )
Where the ID is a useful parameter, and the date parameter we do not do processing.
Check the data learned that the Post method can be avoided in this issue, post is considered a variable access (browsers think that post submission, must be changed).
There is also a simpler way to set:
Copy Code code as follows:
Cache:false,
The premise is that the cache for this request does not exist yet.