如何防止在Internet Explorer中緩存jQuery Ajax請求?如何在Internet Explorer中阻止jQuery Ajax請求緩存?
3 回答

慕桂英3389331
TA貢獻2036條經驗 獲得超8個贊
您可以使用全局禁用緩存$.ajaxSetup()
,例如:
$.ajaxSetup({ cache: false });
這會在發出請求時向查詢字符串附加時間戳。要為特定$.ajax()
呼叫關閉緩存,請cache: false
在本地設置它,如下所示:
$.ajax({ cache: false, //other options... });

互換的青春
TA貢獻1797條經驗 獲得超6個贊
如果設置了唯一參數,則緩存不起作用,例如:
$.ajax({ url : "my_url", data : { 'uniq_param' : (new Date()).getTime(), //other data }});
- 3 回答
- 0 關注
- 443 瀏覽
添加回答
舉報
0/150
提交
取消