Home > Web Front-end > JS Tutorial > body text

How to prohibit the load method in JQuery from loading files in IE cache_jquery

WBOY
Release: 2016-05-16 18:46:51
Original
1312 people have browsed it

The usage is as follows:

Copy the code The code is as follows:

$("#panel"). load("test.asp");
//When the page is loaded, the content of test.asp in the DOM element with the ID #panel.

However, when you modify the content of the test.asp file and reload the file using the above method under the IE browser, you will find the content of the DOM element with the ID #panel No change has occurred, so where does the problem occur? It turns out that after reloading, the IE browser did not re-download the modified test.asp from the server, but directly read the unmodified test.asp file loaded before from the IE cache, so the #panel element appeared first. The content has not changed.

Therefore, before using the above method, you need to disable this method to load files in IE cache. The method is as follows:
Copy code The code is as follows:

//Use this method to prohibit the load method from calling IE cache files before calling the load method
$.ajaxSetup ({
cache: false
}) ;
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template