How to redirect by using jquery?

后端 未结 4 772
囚心锁ツ
囚心锁ツ 2021-01-29 06:19

I have on log in page if user enters both user name and password same then i have to forward user to next page how is it possible.

how do i do this?

相关标签:
4条回答
  • 2021-01-29 06:24

    It will be better if you can do this in the server side language itself. You will be validating the user credentials using a server side language and if that evaluates to success then you can redirect the page to a new one from there itself. No need to do this in javascript.

    0 讨论(0)
  • 2021-01-29 06:36
    window.location = '/next-page';
    

    Plain JS...

    0 讨论(0)
  • 2021-01-29 06:45

    have some server side authentication in PHP and if that succeeds, use client side stuff (jquery or JS) to redirect

    0 讨论(0)
  • 2021-01-29 06:46

    Try this:

    window.location.replace("http://stackoverflow.com");

    0 讨论(0)
提交回复
热议问题