Blogger Information
Blog 39
fans 0
comment 0
visits 34695
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
$ajax() 的用法 4月10 作业
美丽城堡
Original
629 people have browsed it

$ajax() 方法的演示:

实例

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>$.ajax()</title>
</head>
<body>
	<h2>用户登录</h2>
	<form>
		<p>用户名:<input type="text" name="name"></p>
                <p>密码:<input type= "password" name="pass"></p>
                <input type="submit" value="提交" >
                <input type="reset" valute="重置">
	</form>
</body>
</html>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
	 $(':input').blur(function(){
		$.ajax({
			url: 'api/demo.php',
			type: 'GET',
			data: $('form:first').serializeArray(),
			success: function(msg,status,xhr) {
				console.log(msg)
				$('p span').empty()
				$('p').append($(msg))
			}			
		})
    })
	
</script>

运行实例 »

点击 "运行实例" 按钮查看在线实例


Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post