开发者

Setting a cookie to remember if chat box is open or closed

I am adding a chat feature to every page of a PHPBB site. I need the chat bar to be consistently open or closed throughout the users session, as well as when they return.

Here's an example of the chat bar. http://tennesseeclassictruckclub.com/forum/yshout/slide.html

I think I need to set a cookie that will remember the users preference. Not familiar with cookies, so I need a little guidance.

1) Javascript/Jquery code to set the cookie and state of chat bar ("1" for open "0" for closed is fine).

2) Example of how to read the cookie.

Will this cookie interfere with any cookie开发者_如何学JAVA's PHPBB sets?


you'll want to use http://plugins.jquery.com/project/Cookie and as long as you name your cookies uniquely enough, no worries about interference.

More detail here: http://webhole.net/2010/07/10/jquery-cookies-example/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜