而不是其他平台和浏览器

而不是其他平台和浏览器

本文介绍了同步AJAX调用失败在iPad上,而不是其他平台和浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

没有人知道为什么一个同步Ajax调用会失败,并为在Safari浏览器下面的错误在iPad上,但同样的code正常工作的我测试过这么远?所有其他平台和浏览器

Does anyone know why a synchronous ajax call would fail and give the following error on Safari on an iPad, but the same code works fine on all other platforms and browsers I've tested so far?

NETWORK_ERR:XMLHtt prequest异常101:在同步请求时出现网络错误

NETWORK_ERR: XMLHttpRequest Exception 101: A network error occurred in synchronous requests.

这是错误表明我试图跨域请求,但我不是;请求的URL是在同一台主机上,而事实上它是一个相对URL。即使在平凡的试验,失败在iPad上(并适用于所有其他平台和浏览器,包括Safari),所以我相信我已经排除了超时的可能性。

That error suggests that I'm attempting a cross-domain request, but I'm not; the requested URL is on the same host, and in fact it's a relative URL. Even in trivial tests, this fails on the iPad (and works on all other platforms and browsers, including Safari), so I'm confident I've ruled out any possibility of a time out.

此外,相同的要求,如果做异步,完美的作品在iPad上;它只是说给101的异常同步请求。它的驾驶我疯了!

Also, the same request, if made asynchronously, works perfectly on the iPad; it's only synchronous requests that give the 101 exception. It's driving me crazy!

细节还有一个位:这只是发生我的生产服务器上。同步AJAX调用实际上工作正常我的开发服务器上。这两种服务器需要相同的客户端证书......所以我不认为有有什么不同。我不认为两个服务器之间的任何差别可能有效果在这里。

One more bit of detail: this only happens on my production server. The synchronous ajax call actually works fine on my development server. Both servers require the same client certificate... so I don't think there's any difference there. I can't think of any difference between the two servers that could have an effect here.

任何洞察到这一问题将大大AP preciated。谢谢!

Any insight into this problem would be greatly appreciated. Thanks!

推荐答案

事实证明,我们的发展和生产系统之间的主要区别是证书的要求。

It turns out the key difference between our development and production systems is the certificate requirement.

这个问题原来是用在iPad上的Safari版本的方式XMLHtt prequest.send()的一个问题处理上的一个域的证书保护的同步请求。我无法解释方法的内部,但不知何故,它有一个问题,抛出101异常,相信它 - 很明显 - 是一个跨域请求。再次,相同的要求而作出异步同一证书保护的服务器工作得很好。令人沮丧的情况下,和一个无解!

The issue turns out to be a problem with the way XMLHttpRequest.send() on the iPad version of Safari processes a synchronous request on a domain that is certificate-protected. I can't explain the internals of the method, but somehow it has a problem and throws the 101 exception, believing it--apparently--to be a cross-domain request. Again, the same request made asynchronously on the same certificate-protected server works just fine. Frustrating case, and one with no solution!

这篇关于同步AJAX调用失败在iPad上,而不是其他平台和浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 06:48