Skip to content Skip to sidebar Skip to footer

Window.navigate Works Only In Internet Explorer

I can navigate web pages with window.open('http://www.example.com', '_self'); and it will work with all browsers. But when I use the following code: function f1() { window.nav

Solution 1:

window.navigate is a non-standard Internet Explorer feature. Other browsers simply don't provide the function.

You could shim it with:

if (! window.navigate) {
    window.navigate = function (arg) {
        location.assign(arg);
    }
} 

… but your code would be better if you just rewrote it to use standard methods (i.e. the location object) in the first place.

Solution 2:

This could easily be the answer on your problem.. You're missing href.

window.location.href = 'URL';

Answer: Should I use window.navigate or document.location in JavaScript?

EDIT:

Well, was copied from wrong place.

Possible duplicate of:

button javascript works on IE but not firefox window.navigate()

Answer:

If you check the documentation for that method, you will see the quite common:

There is no public standard that applies to this method.

Post a Comment for "Window.navigate Works Only In Internet Explorer"