我希望更新网址而不重新加载页面或刷新。我尝试过以下逻辑,但没有运气。每次页面加载。有什么帮助吗?
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + '?k=' + vm.name + '&l=' + vm.sid;
//var newurl = $location.protocol() + "//" + $location.host() + $location.path() + '?k=' + vm.name + '&l=' + vm.sid
//window.history.pushState({ path: newurl }, '', newurl);
//window.history.replaceState(null, null, newurl);
//window.location.hash = 'k=' + vm.name + '&l=' + vm.sid
//document.location = newurl;