timeout: 10000,
不是你自己设置的超时么?

解决方案 »

  1.   

    我不太肯定timeout的作用。但是从它的解释来看,它是指指的是“10秒之内如果没发出请求就放弃”,而不是“10秒之内如果没收到返回数据就放弃”:timeoutSet 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.而事实上,如果把timeout改成“timeout: 20000,”,在Safari中仍然得不到正常结果。而改成“timeout: 5000,”,在其他浏览器中也不影响结果。所以Sarafi的问题还是存在,貌似无关timeout的值。
      

  2.   

    async属性改为true吧,异步请求safari没有10秒的限制。同步请求的话,safari会忽略timeout的设置,并且固定为10秒超时。safari为什么这么变态?