0
我有一个下面的代码附加URL。代码正常工作。然而,replaceState并没有像我想的那样工作。基本上,我只是希望页面不会重新加载/刷新时,URL附加文本。任何建议如何解决这个问题?通过replaceState追加Url防止页面重新加载
<script>
$(document).ready(function() {
$("#staff-list").on('change', function() {
history.replaceState(null, null, location.href = "?account=" + $(this).val());
});
});
</script>