AJAX调用在IIS 7和Windows 7中不起作用,同样的应用程序在Windows XP和IIS 5中运行。 [英] AJAX call is not working in IIS 7 and windows 7, the same application is running in Windows XP and IIS 5.

查看:80
本文介绍了AJAX调用在IIS 7和Windows 7中不起作用,同样的应用程序在Windows XP和IIS 5中运行。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AJAX调用在IIS 7和Windows 7中不起作用,同样的应用程序在XP和IIS 5中运行。

请帮帮我。



以下是示例代码



AJAX call is not working in IIS 7 and windows 7, the same application is running in XP and IIS 5.
Please help me out.

Here is the sample code

function UpdateSLDataByRow(strWebServicePath, strServerKey) {
	alert("Update SL Data by row called");
    $(function() {         

         var obj1 = { "strServerKey": strServerKey};
        
       var arg = JSON.stringify(obj1);
        $.support.cors = true;
        $.ajax({
            type: "POST",
            datatype: "json",
            url: strWebServicePath + "/UpdateSLDataByRow",
            data: arg,



            contentType: "application/json; charset=utf-8",
            success: function(data, textStatus, xhr) {
                if (typeof console != "undefined") {
                    if (data.d == 1) {
                        console.log('Transaction Status: OK');
                    }
                    else {
                        console.log('Transaction Status: NG');
                    }
                }
            },
            error: function(xhr, textStatus, errorThrown) {
                if (typeof console != "undefined") {
                    console.log(xhr.responseText);
                    alert(sJSSLWebServicePathError);
                }
            }
        });
    });
}

推荐答案

function (){

var obj1 = { strServerKey:strServerKey};

var arg = JSON .stringify(obj1);
(function() { var obj1 = { "strServerKey": strServerKey}; var arg = JSON.stringify(obj1);


.support.cors = true ;
.support.cors = true;


.ajax({
type: POST
datatype:< span class =code-string> json
url:strWebServicePath + / UpdateSLDataByRow
data:arg,




contentType: 应用/ JSON; charset = utf-8
成功: function (data,textStatus,xhr){
if typeof console != undefined){
if (data.d == 1 ){
console .log(' 交易状态:确定');
}
其他 {
console .log(' 交易状态: NG');
}
}
},
错误: function (xhr,textStatus,errorThrown){
if typeof console != undefined){
console .log(xhr.responseText);
alert(sJSSLWebServicePathError);
}
}
});
});
}
.ajax({ type: "POST", datatype: "json", url: strWebServicePath + "/UpdateSLDataByRow", data: arg, contentType: "application/json; charset=utf-8", success: function(data, textStatus, xhr) { if (typeof console != "undefined") { if (data.d == 1) { console.log('Transaction Status: OK'); } else { console.log('Transaction Status: NG'); } } }, error: function(xhr, textStatus, errorThrown) { if (typeof console != "undefined") { console.log(xhr.responseText); alert(sJSSLWebServicePathError); } } }); }); }


这篇关于AJAX调用在IIS 7和Windows 7中不起作用,同样的应用程序在Windows XP和IIS 5中运行。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆