AJAX Sync Call Fails on iPad, but Not Other Platforms and Browsers

Does anyone know why the ajax synchronous call will fail and give the following error in Safari on the iPad, but does the same code work fine on all other platforms and browsers that I have tested so far?

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

This error assumes that I am trying to execute a cross-domain request, but I am not; the requested URL is on the same host, and in fact it is a relative URL. Even in trivial tests, this does not work on the iPad (and works on all other platforms and browsers, including Safari), so I'm sure that I excluded the possibility of a timeout.

In addition, the same request, if made asynchronously, works fine on the iPad; these are only synchronous requests that give an exception of 101. This is driving me crazy!

One more detail: this only happens on my production server. The ajax synchronous call actually works fine on my development server. Both servers require the same client certificate ... so I donโ€™t think there is any difference there. I can not imagine any difference between the two servers, which could have an effect here.

It would be helpful to appreciate any understanding of this problem. Thanks!

+4
source share
1 answer

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

The problem turns out to be a problem with how XMLHttpRequest.send () in the iPad version of Safari handles a synchronous request in a domain protected by a certificate. I canโ€™t explain the inside of the method, but somehow it has a problem and throws exception 101, believing that it seems to be a cross-domain request. Again, the same request made asynchronously on the same certificate protected server works very well. Disappointment, and one without a decision!

+3
source

All Articles