JQuery getJson方法第一次返回缓存的数据

JQuery getJson method returns cached data for the first time

本文关键字:缓存 数据 返回 第一次 getJson 方法 JQuery      更新时间:2023-09-26

我使用getJson方法从URL获取数据并加载网格,但getJson函数返回缓存的数据。

我尝试使用$.ajaxSetup({ cache: false });,但没有帮助。

试试:

$.ajaxSetup({
    headers: { "cache-control": "no-cache" }
});