我想登录这个网站:https://kintai.jinjer.biz/sign_in我使用POST方法将登录凭据发送到网站表单,并请求登录作为响应。然而,它不起作用。当我点击按钮时,我会被重定向到登录页面。代码有什么问题吗?
<html>
<head>
<title> Approach to Login</title>
<script type="text/javascript" src="https://jinji.jinjer.biz/assets/templates/hr/js/jquery.min.js"></script>
<script async="" src="//wap.wovn.io/1.js"></script>
<script>
$(document).ready(function() {
$("button").click(function(){
$.post("https://kintai.jinjer.biz/sign_in",{
company_code:"5709",
email:"1234",
password:"1234"
},function (data) {
window.open("https://kintai.jinjer.biz/staffs/top");
});
});
});
</script>
</head>
<body>
<button type= "submit"> Login </button>
</body>
</html>发布于 2020-04-28 10:49:53
尝试添加“防止默认”。
$("button").click(function (e) {
e.preventDefault();
$.post("https://kintai.jinjer.biz/sign_in",{
company_code:"5709",
email:"1234",
password:"1234"
},function (data) {
window.open("https://kintai.jinjer.biz/staffs/top");
});
});https://stackoverflow.com/questions/61471366
复制相似问题