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

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

    Verifying that a user is an admin in javascript leads to trouble because javascript code is visible to anyone. The server is the one who should tell the difference between an admin and a regular user AFTER the login process and then generate the new page accordingly.

    Maybe that's not what you are trying to do so to answer your question:

    window.location.href="";
    

提交回复
热议问题