开发者

How to redirect by using jquery?

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?


window.location = '/next-page';

Plain JS...


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.


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


Try this:

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜