jQuery.ajax cache参数

使用方法:jQuery.ajax( options )

其中options有很参数,是以key/value形式出现的。

在使用过程中,遇到过一个问题,就是回调方法不执行,后来查了一下,是缓存的问题。

 

cache Default: true,

Added in jQuery 1.2, if set to false it will force the pages that you request to not be cached by the browser.

所以如果不想使用缓存,只要cache:false就可以了。

 

如:

$.ajax({
   type: "POST",
   url: "some.php",

   cache:false,
    success: function(msg){
      alert( "Data Saved: " + msg );
   }
 });

 

详细请参照官方网站:http://docs.jquery.com/Ajax/jQuery.ajax

你可能感兴趣的:(jquery,function,cache,url)