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

后端 未结 5 1446
温柔的废话
温柔的废话 2020-12-01 04:18

What is the difference between $.ajax(); and $.ajaxSetup(); in jQuery as in:

$.ajax({
    cache:false
});

and

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-01 04:41

    ajaxSetup sets default values to be valid for all ajax requests. After this you don't have to do the same setting in $.ajax

    All settings in $.ajax will be valid only for that ajax call.

提交回复
热议问题