<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><title>欢迎登录</title><scriptsrc="http://www.jq22.com/jquery/jquery-1.10.2.js"></script></head><body><div><h2>登录</h2><labelfor="use"><span>用户名:</span><inputtype="text"id="use"></label><br><labelfor="pwd"><span>密 码:</span><inputtype="password"id="pwd"></label><div><buttononclick="toHome()">登录</button><ahref="./regist.html">注册</a></div></div><script>functiontoHome(){
varusername=$("#use").val();
varpassword=$("#pwd").val();
$.ajax({
async: false,
type: "POST",
url: "http://localhost:8000/loginCheck",
data: {
username: username,
password: password },
success: function (response) {
if (response.success==true) {
location.href="./home.html" } else {
alert(response.msg)
}
}
})
}
</script></body></html>