Safari浏览器-jQuery-Ajax 500内部服务器错误
我已经创建了一个jquery ajax调用,并且在Chrome,firefox和IE中都可以正常工作.
I have created an jquery ajax call and it is working fine in Chrome, firefox and IE.
与Safari中一样,它在响应中给出500个内部服务器错误.我虽然可能是由于服务器异常.但是当我尝试调试时,我发现它根本没有击中服务器.
Where as in Safari, it is giving 500 internal server error in the response. I though it could be due to an exception from Server. But when i tried debugging, i found that it is not hitting the server at all.
更奇怪的是,ajax调用适用于每个备用调用.呼叫1失败,然后呼叫2成功.
The wierd thing in this is, the ajax-call works for every alternate calls. Call-1 fails and then call 2 succeeds.
附上请求和响应(成功和错误)的屏幕截图.请帮助我解决此问题.
Am attaching the screen shot of the request and response(both success and error). Please help me to fix this problem.
预先感谢,拉加夫
var coId = globalObject.GetCompanyIdFromUrl();
if ($("#headerCompanyMenu").length > 0 && coId != "") {
var strData = "{\"coId\":\"" + coId + "\"}";
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
cache: false,
url: globalObject.rootPath + "search/webmethod.aspx/GetCoHeaderData",
data: strData,
async: true,
success: function (d) {
var coHeaderData = JSON.parse(d);
$("#lblCoNm").html(coHeaderData.lblCoNm);
$("#lbl_prim_im").html(coHeaderData.lbl_prim_im);
$("#lbl_prim_md").html(coHeaderData.lbl_prim_md);
$("#lbl_prd_own").html(coHeaderData.lbl_prd_own);
$("#lbl_geo_own").html(coHeaderData.lbl_geo_own);
$("#lbl_org_inv").html(coHeaderData.lbl_org_inv);
$("#lbl_out_inv").html(coHeaderData.lbl_out_inv);
$("#lbl_cur_val").html(coHeaderData.lbl_cur_val);
$("#lbl_nbv").html(coHeaderData.lbl_nbv);
$("#lbl_fv").html(coHeaderData.lbl_fv);
$("#lblProc").html(coHeaderData.lblProc);
$("#lblFinGrd").html(coHeaderData.lblFinGrd);
if (coHeaderData.addNewDeal == "true")
$("#lnkAddNewDeal").show();
if (coHeaderData.coDeals.length > 0) {
BindData("coDealsTmpl", coHeaderData.coDeals);
$("#coDeals").show();
}
},
error: function (error) {
//alert("Company search error");
}
});
从Win7运行野生动物园.实际的Mac Safari浏览器可以完美加载它.Ajax调用没有错误.
Am running the safari from Win7. The actual Mac's safari loads it perfectly fine. No errors for ajax call.
该服务器是运行iis 7的Windows2008.没有负载平衡服务器.每次ajax调用使用相同的方法,具有相同的输入数据并期望具有相同的输出数据时,都将使用相同的服务器.
The server is windows 2008, running iis 7. No loadbalancing servers. Each time the ajax-call is hitting the same server same method, with same input-data and expects the same output data.
我要说的是,调用失败的原因是由于在IIS下使用Windows身份验证时Safari中存在错误.转到网站的身份验证"设置.右键单击Windows身份验证,选择提供程序并删除Negotiate,使NTLM正常运行.我尚未测试Kerberos.
I would say that the reason the call is failing is because of a bug in Safari when working with Windows Authentication under IIS. Go to the Authentication settings of your website. Right click on Windows Authentication, choose providers and remove Negotiate, leaving NTLM which works fine. I haven't tested Kerberos.
此问题仅出现在某些版本的safari中.
This issue only appears in certain builds of safari.