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

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -