Here we will introduce jQuery. cookie, a plug-in compatible with all major browsers for processing cookies. For more information, see the following overview.
Using Native JavaScript to process cookies is a headache, and jQuery itself does not have a function to process cookies,
However, this extremely small jquery plug-in (about 500 bytes after compression) can be used to process the reading, writing, and deletion of cookies.
Compatibility
IE6 +, Chrome, Firefox, Safari, and Opera
Framework dependency
Dependency framework: jQuery1.0 +
Module support
Currently, no modules are supported.
Introduction
1. Create a cookie using the $. cookie. write method. The sample code is as follows:
$. Cookie. write ('cookie _ name', 'cookie _ value', 24*60*60 );
2. read the cookie using the $. cookie. read method. The sample code is as follows:
$. Cookie. read ('cookie _ name ')
3. Use the $. cookie. destory method to delete a cookie. The sample code is as follows:
$. Cookie. destroy ('cookie _ name ')
Download connection
Https://github.com/stefangabos/Zebra_Cookie/
Authorization information
Authorization type: LGPL
Authorization type: https://github.com/stefangabos/Zebra_Cookie/blob/master/license.txt
Change log
Http://stefangabos.ro/jquery/zebra-cookie/#changelog
Other supplements
A good plug-in, recommended