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

后端 未结 9 522
野性不改
野性不改 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:10

    To simply redirect a browser using javascript:

    window.location.href = "http://example.com/new_url";
    

    To redirect AND submit a form (i.e. login details), requires no javascript:

提交回复
热议问题