Introduction to Ajax
Ajax, "Asynchronous JavaScript and XML" (Asynchronous JavaScript and XML), refers to a web development technology that creates interactive Web applications.
AJAX = Asynchronous JavaScript and XML (a subset of standard generic markup languages).
AJAX is a technique for creating fast-moving web pages.
AJAX enables asynchronous updating of Web pages by making a small amount of data exchange in the background with the server. This means you can update portions of a Web page without reloading the entire page.
The following code, in other browsers, is normal, but there are strange problems in IE8.
$.ajax ({
url:dataurl,
Data:encodeuri (currentjsonform),
dataType: ' JSON ',
success:function (item) {
debugger;
....
}
After careful investigation, NI is IE8 the existence of Ajax caching problem. NI, executed here, in fact, and did not access our background code, but used the results of the previous cache, debugging in the background, there is no response, only to find that this problem!!!! IE8 is willing to fall.
But strangely, many places are such code, why only here is cached, but the other place does not have the cache problem?
Workaround:
1.
2. Parameter plus attribute: Cache:false
$.ajax ({
url:dataurl,
Data:encodeuri (currentjsonform),
dataType: ' JSON ',
cache:false,
Success:function (item) {
debugger;
....
}
});
3. You can also add a time stamp to the URL followed by the method.
Lesson:
Programmers really should: cross the road to look both ways!
Don't be too trusting with default values, what attributes are required, be sure to indicate. So it's best to point each time: Cache:false, or every JS page to ensure that at the beginning of the execution:
In fact, the path with the time stamp or random number of methods, sometimes unreliable! Maybe the browser will ignore it. Anyway, IE8 encountered the URL with timestamp failure.
The above is a small set to introduce the IE8 under the AJAX cache problem, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!