Mat*_*all 12

var url = window.location.toString();
window.location = url.replace(/function=search/, 'function=loginsearch&user=admin&password=admin');
Run Code Online (Sandbox Code Playgroud)


toc*_*lle 7

在不重新加载页面的情况下更新显示的 URL 的唯一方法是history.pushState

window.history.pushState('', '', '/your-new-url');
Run Code Online (Sandbox Code Playgroud)