jQuery .ajax() does not work in Safari when it takes seconds to get returned data

后端 未结 2 1925
花落未央
花落未央 2021-02-10 09:40

I\'m using the jQuery ajax() method to pass on (GET) data to another ExportData page, and get the returned data (\"succeeded/failed\") after that page processes. The ExportData

2条回答
  •  闹比i
    闹比i (楼主)
    2021-02-10 10:03

    Try setting a timeout in your settings object.

    Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period.

提交回复
热议问题