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
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="";