当#tag位于地址栏中的URL末尾时,例如" http://example.com/pagename#"然后在点击事件上,我想通过使用window.location Javascript事件在页面上重定向,然后它不起作用。
var redirectURL = window.location.href.split('?')[0];//Remove all existing query string
redirectURL = redirectURL + "?" + newqueryStringName + "=" + newqueryStringValue;
window.location = redirectURL;
当地址栏中存在#时,如何重定向到新页面。