如何使用历史记录推送状态 [英] How to use history pushstate
本文介绍了如何使用历史记录推送状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用 history.pushstate
修改URL内容,这对我来说是一个更好的AJAX解决方案,当任务完成时,我从
I used history.pushstate
to modify the URL content, which was a better AJAX solution for me, when the task was completed, I got this method from here. Now, I want to clear the URL after certain task are completed. What am I supposed to do in order to clear the modified URL back into the original URL?
推荐答案
window.history.pushState("","", "heyIJustChangedMyUrlWithoutPosting");