JavaScript navigate method

In the JavaScript we have navigate() method which can help users to navigate to the various locations.

JavaScript navigate method

JavaScript navigate method

     

In the JavaScript we have navigate() method which can help users to navigate to the various locations. We can make beautiful applications by using the method navigate like the photo gallery and many more which are based on the navigation.  

 

 

 

 

 

Syntax

 window.navigate("specified_location");

where specified_location is the URL to which the page should navigate.

Description of code:

In this section of JavaScript method we will describe you that how you can use the navigate method into your web page's html code. We have created a button "Navigate" when this button is clicked then it calls the method funcNavigate() which navigates to the specified URL "http://www.roseindia.net". Given below is the full source code for navigation example :

<html>
<body>
  <script language="JavaScript">
  function funcNavigate() {
  window.navigate("http://www.roseindia.net");
  }
  </script>
 <div align="center">
 <center>
  <table border="0" width="45%" bgcolor="#800080">
   <tr>
   <td width="100%" align="center">
  <p align="center"><font face="Comic Sans MS" size="7" color="#FFFFFF">
   navigate method</font></td>
  </tr>
   </table>
 </center>
 </div>
   <center>
  <p>Click to navigate RoseIndia Home</p>
   </center>
  <p align="center">
  <input type="button" value="Navigate" onclick="funcNavigate();">
   </p>
</body>
</html>

Output :

When user clicks on the button navigate this page navigates user to another web page www.roseindia.net

Download Source Code