jQuery: Making simultaneous ajax requests, is it possible?

前端 未结 2 1901
心在旅途
心在旅途 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: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)

提交回复
热议问题