多个参数通过jquery传递给web方法 [英] multiple parameter passing throug jquery to web method

查看:67
本文介绍了多个参数通过jquery传递给web方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

function testJson(){

alert(enter);

$ .ajax({

type:POST,

url:http://xyz.com,

数据:{用户名:'abc',密码:'abcd'},



contentType:application / json; charset = utf-8,

dataType:json,

成功:函数( ){

提醒(选择);

},

错误:function(){

alert (错误的);

}

});

};

我的问题是,当我运行此代码它不工作,它进入错误部分和我认为通过此代码传递参数到webservice有问题.Plz帮助

function testJson() {
alert("enter");
$.ajax({
type: "POST",
url: "http://xyz.com",
data: {username:'abc',Password:'abcd'},

contentType: "application/json; charset=utf-8",
dataType: "json",
success: function() {
alert("select");
},
error: function() {
alert("wrong");
}
});
};
My problem is that when i m running this code its not working as, its going into error part and what i think there is a problem in passing parameters to webservice through this code.Plz help

推荐答案

。 ajax({

类型:POST,

url:http://xyz.com,

数据:{用户名:'abc',密码:'abcd'},



contentType:application / json; charset = utf-8,

dataType:json,

成功:function(){

alert(select);

},

错误:function(){

alert(错误);

}

});

};

我的问题是,当我运行此代码时它不起作用,它进入错误部分和我的想法通过此代码将参数传递给webservice时出现问题.Plz帮助
.ajax({
type: "POST",
url: "http://xyz.com",
data: {username:'abc',Password:'abcd'},

contentType: "application/json; charset=utf-8",
dataType: "json",
success: function() {
alert("select");
},
error: function() {
alert("wrong");
}
});
};
My problem is that when i m running this code its not working as, its going into error part and what i think there is a problem in passing parameters to webservice through this code.Plz help


请将您的Web服务的完整URL放入url类型,bcoz你只在这里放了http ...那是错误...



如果从WebMethod获得响应有任何问题,那么只有它会进入错误部分...



试试这个,希望这会对你有所帮助..
Please put the complete url of your Webservice into the url type, bcoz u have put only http here...that's the error...

If there is any problem in getting the response from WebMethod then only it will goes into the error part...

Try this, hope this will helps you..


嗨Nishant,

我按照你告诉我做的但是我可能还会误入歧途你再次查看我的jquery代码吗?
Hi Nishant ,
I have did as you told me but still i am into error part, May you check my jquery code again?


这篇关于多个参数通过jquery传递给web方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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