H5的跳转页面问题

<script>
$("#btn").click(function(){


$.post("denglu.php",{"username":$("#text1").val(),"userpass":$("#text2").val()},function(result){  //利用AJAX将前端ID为text1,2的value值 上传给服务器。

if(result==1){  //服务器返回的数据,当为1时 进行下面的操作。

location.href='zhengshi.html';  //跳转页面,跳转到所需要的页面

}
else  //返回结果不为1时   弹出对话框,显示错误!

alert("用户名密码错误");



})

})
</script>

posted @ 2016-05-10 12:51  逆流的致爷  阅读(1708)  评论(0编辑  收藏  举报