
已解决问题
谷歌**didaon71v用户在2016.04.19提交了关于“维他奶被拒ajax传递多个参数具体实现”的提问,欢迎大家涌跃发表自己的观点。目前共有1个回答,最后更新于2025-02-25T13:32:24。希望大家能够帮助她。详细问题描述及疑问:期待您的答案,我不知道说什么才好,除了谢谢 !
详细问题描述及疑问:期待您的答案,我不知道说什么才好,除了谢谢 !
复制代码代码如下:
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXh**
<htmlxmlns
<head>
<title></title>
<scriptsrc="js/Jquery1.7.js"type="text/j**ascript"></script>
<scripttype="text/j**ascri
$(func
$('#Bu
varpwd=$('#t
$.ajax({
ty
contentType:"ap
url:"WebService1.a**x/Log
data:"{username:'"+username+"',pwd:'"+pwd+"'}",
success:function(bukeyi){
if(b
window.location='
}
el
$('#divinfo').text("用户名或密码错误");
}
}
})
})
})
</script>
</head>
<body>
用户名<in
密码<inputid="txtPwd"type="text"/><br/>
<inputid="Button1"type="button"
<di
</body>
</ht
------WebService1.a**x-
复制代码代码如
usingSystem;
usingSystem.Collections.Generic;
usingSys
usingSystem.Web;
usingSystem.***.
namespaceajax11
///<summary>
///WebServi
///</summary>
[
[WebServiceBinding(ConformsTo=WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
//若要允许使用***.NETAJAX从脚本中调用此Web服务,请取消对下行的注释。
[System.Web.Script.Services.ScriptService]
publicclassWebService1:System.***.Services.WebService
{
[WebMethod]
publicstringh**elloWorld()
{
return"h**elloWorld";
}
[WebMethod]
publicstringValidateUser(stringusername)
{
if(username=="onlifes")
{
return"用户名已被占用,请选择其他";
}
else
{
return"可以使用,请继续";
}
}
[WebMethod]
publicstringGetDate()
{
returnDateTime.Now.ToString("yyyy-MM-ddhh:mm:ss");
}
[WebMethod]
publicstringLogin(stringusername,stringpwd)
{
if(username=="admin"&&pwd=="888888")
{
return"true";
}
else
{return"false";}
}
}
}