如何解决PushState在第一次单击上的上一步时不起作用,以及如何重新加载页面
您好,我在pushState
方面遇到一些问题。如果我单击上一个按钮,则“第一次单击”没有任何反应,然后在第二个按上一个按钮后,它会起作用。
当我单击上一个按钮时,HTML页面将变为changepassword
div。
如果我重新加载页面并显示其changepassword div,则已经修复了该问题,它也将加载并显示changepassword DIV。但是我不了解上一步,没有重新加载吗?
//If account account is clicked
$('#accountClick').click(function() {
window.history.replaceState(null,null,'account-overview.php?account');
history.pushState(null,'account-overview.php?account');
});
//If account changepassword is clicked
$('#changepasswordClick').click(function() {
window.history.replaceState(null,'account-overview.php?changepassword');
history.pushState(null,'account-overview.php?changepassword');
});
//If account order-history is clicked
$('#orderHistoryClick').click(function() {
window.history.replaceState(null,'account-overview.php?orderhistory');
history.pushState(null,'account-overview.php?orderhistory');
});
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。