Adding a general parameter to all ajax calls made with jQuery

后端 未结 4 1098
离开以前
离开以前 2021-01-11 09:19

I\'m using AJAX to load data from the server as needed. I\'m currently working on updating the server software to the latest version. One of the things I noticed that has ch

4条回答
  •  既然无缘
    2021-01-11 09:48

    What you're looking for is a Prefilter, here's a sample from the page:

    $.ajaxPrefilter( function( options, originalOptions, jqXHR ) {
      // Modify options, control originalOptions, store jqXHR, etc
    });
    

    This requires JQuery 1.5.

提交回复
热议问题