Skip to content Skip to sidebar Skip to footer

Document.location

How do you use document.location? Is it HTML or in JS? Please help me out!

Solution 1:

It is javascript.

document.location.href="http://www.google.com"; would redirect you go google

Solution 2:

document is a DOM element. to access it you can use javascript or dom api.

Solution 3:

The JavaScript location object is a property of the window object. It can be used to control the web page displayed by the browser.

More methods and property : http://www.comptechdoc.org/independent/web/cgi/javamanual/javalocation.html

reload() - The current window document is reloaded. If a value of true is passed to the reload function, the reload is forced to do an HTTP GET of the document. This is not normally done but is useful when you think the server contents may be different from your cache.

replace(URL) - Requires a URL as a parameter. It loads the document at the URL on top of the current document. A new entry entry is not placed in the history object.

Post a Comment for "Document.location"