手机
当前位置:查字典教程网 >编程开发 >AJAX相关 >ajax传递一个参数具体实现
ajax传递一个参数具体实现
摘要:复制代码代码如下:$(function(){$('#txtUserName').blur(function(){$.ajax({type:"...

复制代码 代码如下:

<!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>

【ajax传递一个参数具体实现】相关文章:

Ajax+smarty技术实现无刷新分页

Ajax在请求过程中显示进度的简单实现

ajax与传统web开发的异同点

Ajax获取数据然后显示在页面的实现方法

Ajax二级联动菜单实现原理及代码

Ajax初试之读取数据篇实现代码

ajax传递多个参数具体实现

Ajax传输中文乱码问题的解决办法

编写轻量ajax组件第三篇实现

ajax局部刷新一个div下jsp内容的方法

精品推荐
分类导航