js里面动态修改url地址,但是不想刷新页面
window.history.pushState({}, 0, window.location.href + '?type=china');
如下,给url添加mode参数,或者修改mode参数
function changeURL(mode){
window.history.pushState({}, 0, window.location.href.split('?mode=')[0] + '?mode=' + mode);
}
转自【琼台博客】