tags:

views:

288

answers:

3

I need to reload the browser window with a new URL which also will replace/flush content and force reload of the page. window.replace() or window.location doesn't work, any other function I could use ?

+2  A: 
location.href="http://www.example.com";

There is also

location.replace="http://www.example.com";

The latter doesn't mess with the browser history.

Ólafur Waage
+4  A: 

This should do it:

window.location.replace("http://example.com/");

Other ways (but not replacing):

window.location.href = "http://example.com/";
window.location.assign("http://example.com/");
Gumbo
A: 

You meen if I use Ajax navigation. I can use this code. and i will be able to use back button to navigate the previous page?

Aziz