Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Safari - Cannot make any requests from null

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"
                        });
                    });
like image 484
Tim Ferrell Avatar asked Feb 08 '12 21:02

Tim Ferrell


1 Answers

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:

  • exit from Safari
  • double click on the exit button to show the active process
  • hold on Safari
  • click on minus
  • restart safari

strange but true.

like image 131
Redax Avatar answered Oct 05 '22 13:10

Redax