开发者

Javascript events (like onload) repetitive - how to stop?

I got an "intro" running on my site, but I don't want it to repeat for a certain amount of time.

How exactly do you set and define a cookie (or is there any better sol开发者_运维知识库ution), to run something once a day/session/week, etc?


You could set the cookie to expire one day/week from now to handle "once a day, week" scenarios. I don't know about "once a session" - how do you define a 'session' and when does it begin/end?

See Stackoverflow -how to set cookie to expire in 1 hour


Setting a cookie is the most compatible way to do this.

See the MDC document.cookie docs for the full story.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜