将jQuery $ .post()中的缓存设置为false? [英] Setting the cache in jQuery $.post() to be false?
本文介绍了将jQuery $ .post()中的缓存设置为false?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有此代码:
$.post("php/tagNotifUnsub.php", $("#tagNotifUnsub").serialize(), function(){
$('#tagSubDiv').load('tags.php #tagSubDiv', function(){$( "button, input:submit, input:button, a#jql, input:radio" ).button();});
});
我知道$ .post只是$ .ajax的别称.而且我知道$ .ajax默认已缓存.我希望它被取消缓存.我该怎么办?
解决方案
$.post
未缓存.
用POST提取的页面永远不会 缓存,因此缓存和ifModified jQuery.ajaxSetup()中的选项没有 对这些请求的影响.
来自 http://api.jquery.com/jQuery.post/ >
I have this code:
$.post("php/tagNotifUnsub.php", $("#tagNotifUnsub").serialize(), function(){
$('#tagSubDiv').load('tags.php #tagSubDiv', function(){$( "button, input:submit, input:button, a#jql, input:radio" ).button();});
});
I understand that $.post is just another name for $.ajax. And I know $.ajax has caching on by default. I want it to be uncached. How can I do that?
解决方案
$.post
is not cached.
Pages fetched with POST are never cached, so the cache and ifModified options in jQuery.ajaxSetup() have no effect on these requests.
From http://api.jquery.com/jQuery.post/
这篇关于将jQuery $ .post()中的缓存设置为false?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文