Multiple url in same ajax call?is this possible?

后端 未结 4 1033
忘了有多久
忘了有多久 2020-12-01 11:16

Can I send my data to multiple pages using ajax call? I dont want to use another ajax call for this.

Sample code:

 $.ajax({
     type: \'POST\',
             


        
4条回答
  •  离开以前
    2020-12-01 11:57

    A single AJAX request can only talk to one URL, but you can create multiple AJAX requests for different URLs, and they will do their work simultaneously - you wouldn't need to wait for one to complete before firing off the next one.

    (If your URLs are on the same server, you could consider refactoring your server-side code so that a single URL does all the work that your multiple URLs do now.)

提交回复
热议问题