In attemping to get Safari on iOS 5 to load an AJAX request via jQuery, the debug console loads with the error of
Javascript: Error on Line 1
XMLHttpRequest cannot load http://<MYSERVERADDRESS>/WebMethods.asmx/Method. Cannot make any requests from null
I've tried to Google the answer, as well as search SO, but I can't find a resolution.
This issue is only present on iOS.
Any help would be greatly appreciated.
Edit
Below is the code as requested.
jQuery(function ($) {
$.ajax({
url: "/Peak.asmx/IsValidParticipant",
data: { LanID: $("#LoginPageUsername").val(), Password: $("#loginPagePassword").val() },
type: "POST",
success: function (data) {
if (data.response.result == "Success") {
window.location = "/RSVP.aspx";
} else if (data.response.result == "Failure") {
$(".errorsSummaryBox").show().find("li").hide();
if (data.response.data.Reason == "Credentials") {
$("#PortalAuthError").slideDown();
} else if (data.response.data.Reason == "Participant") {
window.location = "/NoInvite.aspx";
}
}
},
dataType: "json"
});
});
I had the same problem, but I found the solution!
You have to restart the Safari process. Not only exit from the main window,but:
strange but true.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With