Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

window.location alternatives in JavaScript

What is a standardized alternative to window.location.href property? I was checking on w3schools.com that it is implemented in all major browsers so there's no problem but I'm rather curious how to do that properly.

From here is the statement that the function is not standardized: https://developer.mozilla.org/en/DOM/window.location

Thanks!

like image 908
Martin Vseticka Avatar asked Jun 02 '10 13:06

Martin Vseticka


2 Answers

The window object goes back as far as the original JavaScript implementation in Netscape 2.0, and location has existed in every browser since then.

The Browser Object Model outside of the DOM has tradionally not been standardised, but that changes with HTML5, which documents the window object and its location property explicitly.

like image 143
bobince Avatar answered Sep 30 '22 18:09

bobince


There is nothing wrong with setting window.location.

like image 33
SLaks Avatar answered Sep 30 '22 17:09

SLaks