有如下代码$.ajax({type:"GET",cache:true,url:'aa.php',dataType:"html",success:function(res){$('.page-loading').remove();$('.page-content.page-content-body').html(res);});发现请求为aa.com/aa.phpaa.com/aa.cssaa.com/aa.js?_=1373600904652这样好像js文件不被缓存请问有没有方法去掉_=1373600904652???
2 回答

慕桂英3389331
TA贡献2036条经验 获得超8个赞
昨晚研究了下这个问题,知道怎么回事了,在你的ajax请求前加一段代码:$.ajaxSetup({cache:true});同时你的那句cache:true可以省略,因为默认就是cache:true,只有dataType为"script"和"jsonp"时cache默认为false。你在此处加的cache:true其实只影响了aa.php的缓存与否。
添加回答
举报
0/150
提交
取消