In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Editor to share with you how to solve the problem of Ajax caching under IE8, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's learn about it!
Introduction to Ajax
AJAX, namely "Asynchronous Javascript And XML" (Asynchronous JavaScript and XML), refers to a web page development technology that creates interactive web page applications.
AJAX = Asynchronous JavaScript and XML (a subset of the standard generic markup language).
AJAX is a technology for creating fast dynamic web pages.
By exchanging a small amount of data with the server in the background, AJAX can update web pages asynchronously. This means that some part of the page can be updated without reloading the entire page.
The following code is normal in other browsers, but there is a strange problem in IE8.
$.ajax ({url:dataUrl,data:encodeURI (currentjsonform), dataType:'JSON',success:function (item) {debugger;....}})
After careful investigation, Nima is an ajax cache problem in IE8. Nima, at this point, in fact, we did not access our background code, but used the previously cached results. When debugging in the background, there was no response, only to find that it was this problem! IE8 is willing to fall.
But the strange thing is that there is such code in many places, why is it that only here is cached and there is no caching problem elsewhere?
Solution:
1.
$.ajaxSetup ({cache: false})
two。 Parameter plus attribute: cache:false
$.ajax ({url:dataUrl,data:encodeURI (currentjsonform), dataType:'JSON',cache:false,success:function (item) {debugger;....}})
3. You can also add timestamps and other methods after the url.
Lesson:
Programmers really should: look on both sides when crossing the street!
Don't put too much faith in the default value, and be sure to specify what attributes are needed. So it's best to specify: cache:false every time, or every js page is guaranteed to be executed once at the beginning:
$.ajaxSetup ({cache: false})
In fact, the path with a timestamp or random number method, sometimes is not reliable! Maybe the browser will ignore it. Anyway, IE8 has encountered the invalidation of url with timestamp many times.
The above is all the contents of the article "how to solve the problem of Ajax caching under IE8". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.