How to go from one page to another page using javascript?

后端 未结 9 514
野性不改
野性不改 2021-01-30 19:37

From an admin page if the user is valid then the browser should go to another page.

When a user enters his user name and password, then clicks the OK button then another

相关标签:
9条回答
  • 2021-01-30 20:18

    Try this,

    window.location.href="sample.html";
    

    Here sample.html is a next page. It will go to the next page.

    0 讨论(0)
  • 2021-01-30 20:19

    The correct solution that i get is

    <html>
          <head>
            <script type="text/javascript" language="JavaScript">
                      function clickedButton()
                {
    
                    window.location = 'new url'
    
                }
                 </script>
          </head>
    
          <form name="login_form" method="post">
                ..................
                <input type="button" value="Login" onClick="clickedButton()"/>
          </form>
     </html>
    

    Here the new url is given inside the single quote.

    0 讨论(0)
  • 2021-01-30 20:22

    Try this:

    window.location.href = "http://PlaceYourUrl.com";
    
    0 讨论(0)
提交回复
热议问题