Why won't window.location load a new page?

IronicMuffin picture IronicMuffin · Jul 20, 2011 · Viewed 22.7k times · Source

This bit of code used to work, and now it doesn't:

var url = myurl +'?id=' + id + '&phase=' + phase;
window.location = url;

Using the IE dev toolbar I've verified that url has a valid url, and window.location returns the new url...the only problem is the page does not reload.

Does anyone know of any reasons for window.location to now actually load a new document when it is assigned to?

Answer

Nicholas Welch picture Nicholas Welch · Jul 20, 2011

Use window.location.href = url; instead.