为了让iOS 5上的Safari能够通过jQuery加载
AJAX请求,调试控制台会加载错误
Javascript: Error on Line 1 XMLHttpRequest cannot load http://<MYSERVERADDRESS>/WebMethods.asmx/Method. Cannot make any requests from null
我已经尝试Google的答案,以及搜索SO,但是我找不到解决方案.
这个问题只出现在iOS上.
任何帮助将不胜感激.
编辑
以下是所要求的代码.
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"
});
});
解决方法
对TFerrell:
RSVP.aspx响应是否包含PDF?如果是在下面尝试使用我的建议.
窒息:
您尝试打开的PDF将打破新的Safari手机5的默认PDF查看器.快速解决方案是弹出一个新的PDF窗口.这将破坏新的弹出页面,但不会打开父页面.另一个解决方案是以PDF格式生成PDF(如果您).