Home > Web Front-end > JS Tutorial > Detailed explanation of jquery.cookie of micro plug-in

Detailed explanation of jquery.cookie of micro plug-in

零下一度
Release: 2017-06-17 17:41:37
Original
1610 people have browsed it

Comprehensive overview

Handling cookies through native JavaScript is a headache, and jquery itself does not have it Solve the function that handles cookies,
But this extremely small (about 500 bytes after compression) jquery plug-in can be used to handle the reading, writing and deletion of cookies .

Compatibility

IE6+, Chrome, Firefox, Safari, Opera

FrameworkDependency

Dependency framework: jQuery1.0+

Module support

No modules are supported yet

Usage introduction

1. Create cookies through the $.cookie.write method, the sample code is as follows:

$.cookie.write('cookie_name', 'cookie_value', 24 * 60 * 60);
Copy after login

2. Read the cookie through the $.cookie.read method, the sample code is as follows:

$.cookie.read('cookie_name')
Copy after login

3. Delete the cookie through the $.cookie.destory method, the sample code is as follows:

$.cookie.destroy('cookie_name')
Copy after login

Download link

github.com/stefangabos/Zebra_Cookie/

Authorization information

Authorization type: LGPL

Authorization type information: github.com /stefangabos/Zebra_Cookie/blob/master/license.txt

Change log

stefangabos.ro/jquery/zebra-cookie/#changelog

Other additions

The plug-in has not been officially encapsulated as a module. You can refer to segmentfault.com/blog/liangyi/1190000000759569 for encapsulation.

The above is the detailed content of Detailed explanation of jquery.cookie of micro plug-in. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template