views:

375

answers:

2

How would I use jQuery to redirect the page to teh base page + some string?

Specifically, I need to set the window.href = current page without params + 'SomeString';

+3  A: 

Try something like this: window.location.href = window.location.pathname + 'SomeString';

Jacob Relkin
Shouldn't it be `window.location.pathname' instead of `window.location.path' ? Other than that bit, I'd say that's the best answer. :)
Dustin
updated my answer, thanks!
Jacob Relkin
That now works great. Using it at http://BiblePro.BibleOcean.com
BahaiResearch.com
A: 
var loc = window.location + '';
window.href = loc.replace('(\?(.+))','') + str;
CodeJoust