微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ajax传递一个参数

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="js/Jquery1.7.js" type="text/javascript"></script> <script type="text/javascript"> $(function () { $('#txtUserName').blur(function () { $.ajax({ type: "post",contentType: "application/json",url: "WebService1.asmx/ValidateUser",data: "{username:'" + $('#txtUserName').val() + "'}",success: function (result) { $('#spinfo').text(result.d); } }) }) }) </script> </head> <body> <div> 用户名<input type="text" id="txtUserName" /><span id="spinfo"></span><br /> 密码<input type="text" id="txtPwd" /> </div> </body> </html>

原文地址:https://www.jb51.cc/ajax/166364.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐