Hosting Solutions
mobile_logo Table of Contents
seal_frontseal_back

location

The location property of the Window object reads the url string of the document, as well as serving as a redirect and reloading mechanism.

Syntaxwindow.location
Read the value of the url string alert( window.location ); Redirect to another website or page window.location = "contact.html"; Reload(refresh) the current page <script> function refreshPage(){ window.location = window.location; } </script> <button onclick="refreshPage()">Refresh</button>

JavaScript

Properties

bodycalleeclosedcookiedocumentdropEffecteffectAllowedfilesframeElementframeshistoryInfinityinnerHeightinnerHTMLinnerWidthlengthlocationlocationbarnameNaNnavigatornullopenerouterHeightparentprototypescreenstatetextContentundefined