多个参数通过jquery传递给web方法

编程入门 行业动态 更新时间:2024-10-12 05:50:02
本文介绍了多个参数通过jquery传递给web方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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方法

本文发布于:2023-11-24 02:22:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1623622.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   参数   方法   jquery   web

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!