Devi
Devi

Reputation:

How to Change the URL without doing any Server Trip

I want to change the URL (QueryString Data) after the Page gets Displayed. How can i do it ?

Upvotes: 0

Views: 204

Answers (2)

Alex Pavlov
Alex Pavlov

Reputation: 598

The javascript object window.location have property href. So you can change it in JavaScript code in such way:

location.href = 'http://stackoverflow.com/'

Upvotes: -2

Quentin
Quentin

Reputation: 943639

You can't. The only part of the location that can be changed without the browser requesting a new URL from the server is the hash (since that is local to the current document).

Upvotes: 7

Related Questions