<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>toggle方法</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="./css/style.css" />
<script type="text/javascript">
$(function(){
$("#ajaxbutton").bind("click",function(){
$.ajax({
url:"ajaxServlet",
type:"post",//请求类型
data://"username=zhangsan&age=19&password=1234",
{
username:"马云",
password:"1234",
age:18
},
timeout:"5000",
success:function(data){
alert(data);
},
error:function(){
alert('出错');
}
});
})
})
</script>
</head>
<body>
<input id="ajaxbutton" type="button" value="ajax调用">
</body>
</html>
jQuery ajax实现
最新推荐文章于 2018-08-09 08:16:57 发布