I want to reload current page with a certain query string.
I’m trying the following code:
document.location.search = '?key=value';
It works very well on modern browsers (such as Firefox or Safari),
but it doesn’t work on IE7.
I tried another code:
document.location.search = '?key=value';
document.location.reload(true);
But it reloads current page without query string and it is not what I want.
How to reload page with specifing query string on IE7?
UPDATE: I’m sorry this is not issue about document.location.search. The cause of problem is missing of ‘return false’ on ‘onclick’ attribute. Thank you for all those who give me advice.
I think you want
document.location.replace(URL)You’ll have to supply the full new URL.