Location.replace() : Location : Location JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Location » Location »

 

Location.replace()










Syntax








location.replace(URL)



The replace() method loads a new page, specified by URL, in the current browser window.

The new page replaces the previous page's position in the history list.












<html>
    <head>
    <title> Using the replace method of the Location object</title>
    </head>
    <body>
    <form name="form1">
    Click the button to load the new page: http://www.navioo.com
    <br>
    <br>
    <input type="button" name="load" value="Load new page"
    onClick='document.location.replace("http://www.navioo.com")'>
    <br>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Location
» Location