function testJson(){ alert(enter); $ .ajax({ type:POST, url:xyz, 数据:{用户名:'abc',密码:'abcd'}, contentType:application / json; charset = utf-8, dataType:json, 成功:函数( ){ 提醒(选择); }, 错误:function(){ alert (错误的); } }); }; 我的问题是,当我运行此代码它不工作,它进入错误部分和我认为通过此代码传递参数到webservice有问题.Plz帮助
function testJson() { alert("enter"); $.ajax({ type: "POST", url: "xyz", 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:xyz, 数据:{用户名:'abc',密码:'abcd'}, contentType:application / json; charset = utf-8, dataType:json, 成功:function(){ alert(select); }, 错误:function(){ alert(错误); } }); }; 我的问题是,当我运行此代码时它不起作用,它进入错误部分和我的想法通过此代码将参数传递给webservice时出现问题.Plz帮助 .ajax({ type: "POST", url: "xyz", 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方法
发布评论