从网址中删除哈希#(不带重定向)
location.hash = "?userid=" + document.getElementById("userid").innerHTML;
location.href.replace('#', '');
编辑:答案= window.history.pushState("","",window.location.href +"?userid =" +文件.getElementById("用户ID&#34)。innerHTML的);
答案 0 :(得分:1)
window.history.pushState("", "", window.location.href + "?userid=" + document.getElementById("userid").innerHTML);