反缓存代码到 jquery getJson
anti cache code to jquery getJson
我在一次采访中被问到这个问题:
向所有jQuery添加反缓存代码的正确语法是什么 getJson 在整个给定项目中调用(不将其添加到每个项目中 getJson call)。他问我一个班轮代码?
我不确定我们如何在一行中做到这一点?
可以使用jQuery.ajaxSetup(options)
设置影响所有后续 AJAX 调用的默认选项,因此可以执行以下操作:
$.ajaxSetup({'cache': false});
jQuery Docs
相关文章:
- jQuery.getJSON失败,语法错误
- jQuery$.getJSON抛出意外令牌
- 在ruby on rails中使用jquery getJSON获取数据
- 如何使用pass参数从jQuery.getJSON获取回调
- JQuery $.getJSON() 不能正确处理回调
- 如何在循环期间访问 jquery getJson 调用 ($.getJson) 中的索引变量
- jQuery $.getJSON Fail
- 如何将URL与JQuery.getJSON()函数一起使用
- jQuery.getJSON无法在具有特殊字符的IE中工作
- Jquery:$.getJSON,具有不同的url端口
- jQuery.getJSON没有返回任何内容
- jQuery getJSON在成功时从不调用成功函数
- jQuery getJSON - 引用预先存在的对象
- JQuery.getJSON() 读取本地文件
- jquery getjson 函数:回调返回错误的字符串
- JSON API 不会在 jquery getJSON 中返回任何结果
- 追加方法使用 from in a Jquery $getJSON
- JQuery $.getJSON 让我感到困惑
- jQuery .getJSON 和 .ajax get request 都返回 null
- 反缓存代码到 jquery getJson