jquery - Difference between $.ajax(); and $.ajaxSetup(); -


what difference between $.ajax(); , $.ajaxsetup(); in jquery in:

$.ajax({     cache:false }); 

and

$.ajaxsetup({     cache:true }); 

also, 1 best option?

the following prevent all future ajax requests being cached, regardless of jquery method use ($.get, $.ajax, etc.)

$(document).ready(function() {   $.ajaxsetup({ cache: false }); }); 

you should use $.ajax, allow turn caching off for that instance:

$.ajax({url: "myurl", success: mycallback, cache: false}); 

Comments

Popular posts from this blog

Python __call__ special method practical example -

How can I edit my VIM config so that Vim treats ".ejs" files the same as it currently treats my html files? -