Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我将如何使用 jQuery 将页面重定向到基本页面 + 一些字符串?
具体来说,我需要设置 window.href = current page without params + 'SomeString';
尝试这样的事情: window.location.href = window.location.pathname + 'SomeString';
window.location.href = window.location.pathname + 'SomeString';
var loc = window.location + ''; window.href = loc.replace('(\?(.+))','') + str;