/* Begining of jQuery cookie part 1 */ /* End of jQuery cookie part 1 */

Srini's Blog

Saturday, December 18, 2010

jQuery cookies - set, get and delete

jQuery can be used to play around with cookies..
As simple as:
Set a cookie: $.cookie('the_cookie', 'the_value');
Get a cookie: $.cookie('the_cookie');
Delete a cookie: $.cookie('the_cookie', null);

There is also :
$.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });

See it below in action :)


Please enter your name





Welcome

Labels: , , , , , , , ,

0 Comments:

Post a Comment

<< Home