📜  js 更新查询字符串而不刷新 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:21.256000             🧑  作者: Mango

代码示例1
if (history.pushState) {
    var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + '?myNewUrlQuery=1';
    window.history.pushState({path:newurl},'',newurl);
}