You are here: Reference > JavaScript > client-side > HTML DOM > methods > navigate (window)

navigate method (window)

Browser support:
Loads the document at the specified URL into the current window.
This method is equivalent to the cross-browser assign method, use that instead.

Syntax:

object.navigate (URL);
You can find the related objects in the Supported by objects section below.

Parameters:

URL
Required. String that specifies the location of the document to load.

Return value:

This method has no return value.

Example HTML code 1:

This example illustrates the use of the navigate method:
Code
newLocation.htm
<head>
    <script type="text/javascript">
        function LoadNewPage () {
            if (window.navigate) {
                window.navigate ("newLocation.htm");
            }
            else {
                location.assign ("newLocation.htm");
            }
        }
    </script>
</head>
<body>
    <button onclick="LoadNewPage ()">Load new document</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content