jQuery: Making simultaneous ajax requests, is it possible?

前端 未结 2 1885
心在旅途
心在旅途 2020-12-01 14:30

I am using jQuery to try and retrieve multiple pieces of data at the same time. The background of the requirement is that different bits of data take various lengths of time

相关标签:
2条回答
  • 2020-12-01 14:42

    Browsers limit you to two simultaneous requests. You might want to use a queue manager, like this: http://www.protofunc.com/scripts/jquery/ajaxManager/

    0 讨论(0)
  • 2020-12-01 14:46

    You want asynchronous (which is the default). The browser limits you to two requests at any given time. This is part of the HTTP specification. (HTTP 1.1 specification, section 8.1.4)

    Putting the requests into the queue is your best option.

    I should note that this can be overridden in Firefox and probably some other browsers. (but as it's not standard, it doesn't help you much)

    0 讨论(0)
提交回复
热议问题