开发者

How do I display a message after a user registers or when he hasn't logged in yet?

I'm a beginner. I want to know how to display an alert message after user registers. After displaying the message, it should redirect to index page.

And, when the user(w开发者_Python百科ho hasn't logged in), clicks a link, it should display an alert message:- You must login first.


Alerts can simply be done by:

alert('You are registered');

Redirect by:

document.location.href = 'http://www.google.com';

Onclick by:

<a href="#" onclick="alert('You must login first'); return false;">Click me</a> 

But since you are a beginner you probably have a lot more issues to handle.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜