Home  >  Article  >  php教程  >  IE下getJSON不工作的解决办法

IE下getJSON不工作的解决办法

WBOY
WBOYOriginal
2016-06-21 08:49:58933browse

应该有不少的新童鞋会碰到这个问题,getJson在IE下不工作。。。。。
$.getJSON();
问题出在哪里呢?
原因:IE浏览器会读取第一缓存,只要阻止即可。
var noCache = Date();
$.getJSON("url",{"noCache":noCache},callback)

还有一种解决办法就是用$.ajax()代替

$.ajax({type:"GET",url:"url",dataType:"json",cache:false,callback});

来源:http://bbs.php100.com/read-htm-tid-481956.html



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