Document location gives you an access to an object containing useful information about the current URL and methods for updating and redirecting. Use the dot notation to access object properties and methods.
#javascript#document
document.location// returns a full list of methods and propertiesdocument.location.hash// returns a string marked with the # sign document.location.hostname// returns the base domain namedocument.location.href// returns a full url including query string and hashdocument.location.pathname// returns the the page or a subfolderdocument.location.search// returns a string marked with the ? sign document.location.reload()// forces page reloaddocument.location.assign('new-url')// redirects to a new url and saves it to the browsing history