作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的网站是这样运行的:1. 用户输入用户名和密码,然后按提交。2. 提交时,Ajax 会发送到检查信息并回显 1、2 或 3 的页面。3. 根据ajax结果,将用户发送到应用程序窗口。
我需要什么:当用户被发送到应用程序窗口时,我希望将用户 ID 粘贴到新地址。
<script>
$(document).on("click", "#submit", function(event)
{
var user = document.getElementById("name").value;
var pwd = document.getElementById("pwd").value;
$.post("userExistCheck.php",
{
userName: user,
userPass: pwd
},
function(result)
{
if (result == "0")
{
window.location.replace("Moment/momentApp.php");
}
else if (result == "1")
{
alert("Password is incorrect!");
}
else
{
alert("User does not exist!");
}
});
})
</script>
最佳答案
嗨,只需更改此行
window.location.replace("Moment/momentApp.php?userid=" + userid);
关于javascript - 如何在 window.location.replace 代码中发送帖子信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38079060/
我是一名优秀的程序员,十分优秀!