Home  >  Article  >  Web Front-end  >  $.getJSON在IE下失效的原因分析及解决方法_jquery

$.getJSON在IE下失效的原因分析及解决方法_jquery

WBOY
WBOYOriginal
2016-05-16 17:32:101195browse
复制代码 代码如下:

$.ajaxSetup({ cache: false });
$.getJSON("/MyQueryUrl",function(data,item) {
// do stuff with callback data
$.ajaxSetup({ cache: true });
});

原因:getJson在IE下IE下默认会使用浏览器缓存,所以导致数据不显示
解决:让其不要使用缓存

这里有更多的解决方法
http://stackoverflow.com/questions/264216/getjson-returning-cached-data-in-ie8
Statement:
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