81,094
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html>
<html>
<head>
<title>login.html</title>
<meta name="keywords" content="keyword1,keyword2,keyword3">
<meta name="description" content="this is my page">
<meta name="content-type" content="text/html; charset=UTF-8">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js">
</script>
<script type="text/javascript">
$(function() {
$("#login").click(function() {
$.ajax({ //no need to judge the browser type
type : "POST", //类型
url : "myServlet", //请求访问的servlet
dataType : "html",
data : {
}, //传递的参数
success : function(returnedData) { //成功返回的回调函数
}
});
});
});
</script>
</head>
<body>
<form>
<label>用户名</label> <input type="text" /> <br /> <label>密码</label> <input
type="text" />
<button type="button" id="login">登陆</button>
</form>
</body>
</html>