XMLHttpRequest 101 exception on iOS devices

I recently started getting the following jquery ajax call message only on iOS devices:

ERROR: NETWORK_ERR: XMLHttpRequest 101 exception

For several months, an ajax call worked on all devices, but one of my clients started receiving this message last week.

I read some posts stating that this is a cross domain problem, but this should not be applicable in this case.

I also read that changing async to true will fix the problem, but I want to avoid this if I can.

Here is the ajax call:

the serverSideFunction parameter is in the form "AdvancedDistribution.aspx / SaveClicked" where AdvancedDistribution.aspx is, of course, an aspx file, and SaveClicked is a static WebMethod (C #).

para is just a 2d array with parameter values.

function ajaxCall(serverSideFunction, para) { ajaxReturn = ""; var dataPara = "{"; for (var i = 0; i < para.length; i++) { dataPara += "'" + para[i][0] + "':'" + para[i][1] + "'"; if (i < para.length - 1) dataPara += ","; } dataPara += "}"; $.ajax({ type: "POST", url: serverSideFunction, data: dataPara, async: false, //&&JS01112013.2 Fix bug caused by IOS6 ajax caching headers: {"cache-control": "no-cache"}, beforeSend: function (xhr) { xhr.setRequestHeader("Content-type", "application/json; charset=utf-8"); }, contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg, status) { ajaxReturn = msg.d; }, error: function (xhr, msg, e) { alert(e); //Error Callback alert('Ajax Callback Failed'); } }); return ajaxReturn; } 

Since this still works on most devices, I hope it will be as simple as adding and the required IOS header to call ajax.

Any ideas?

Thanks.

+4
source share

All Articles