Posted on 30th October 2009No Responses
JavaScript cookies

Sometimes it is useful to employ javascript cookies for certain functionality. An example:

I want to have a DIV element which displays some information and which can be closed by the user (employing the toggle() or show() / hide() functions of ). If the user has closed this box, I don’t want it to reappear for this session. This can be achieved with a small piece of javascript code that creates a :

.('cookiename', 'value');

To read the value of our , we simply need to write the following:

('cookiename');

To utilize this, download this file and put it via javascript include tag in your HEAD of the site.

Share this on:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Add to favorites
  • email
  • MisterWong
  • MySpace
  • Reddit
  • RSS
  • Yahoo! Bookmarks

Related posts

Comments
Leave a Response
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <img src="">