<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<title>页面测试</title>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"> </script>
</head>
<body>
<div>
<p>用户名称:<input type="text" /></p>
<p>用户密码:<input type="password" /></p>
<p>上传文件:<input type="file" id="t" multiple></p>
<input type="submit" />
</div>
<p></p>
</body>
<script>
var res = ajax;
if (res = "成功") {
window.location.href = 'http://127.0.0.1/index.html';
}
else{
window.location.href = 'http://127.0.0.1/logon.html';
}
}
$('input:eq(3)').click(function(){
var obj={
username:$('input:eq(0)').val(),
password:$('input:eq(1)').val()
};
$.ajax({
url:'dt',
method:'post',
data:JSON.stringify(obj),
success:function(res){
$('div+p').html(res)
},
contentType:'application/json'
})
})
</script>
</html>
他现在跳转不了呀老师