Jquery.cookie Plugin official download address and how to use

Source: Internet
Author: User

: Https://github.com/carhartl/jquery-cookie

Jquery.cookie How to use:

To create a temporary cookie:

$. Cookie (' name' value');   

Create a cookie that has a validity period of 7 days:

$. Cookie (' name' value', {expires7});    

Create a cookie with a path that has a validity period of 7 days:

$. Cookie (' name' value', {expires7, Path'/'});      

Read cookies:

$. Cookie (' name//= ' value ' $ '.  Cookie (' nothing//' = undefined     

Read all cookies in the browser:

$.  //+ = {"Name": "Value"}

To delete a cookie:

Returns True when Cookie is successfully deleted, otherwise False$.removecookie (' Name‘);= True$.removecookie (' Nothing‘);//= False//need to use the same attributes (path, domain) as what the cookie W As written with$. cookie ( ' Name ",  "Value", {path:  '/}); //this won ' t Work!$.removecookie ( ' name //= False//this would work!$.removecookie (", {path: ///= True             

Note:when Deleting a cookie, must pass the exact same path, domain and secure options that were used to set the C Ookie, unless you ' re relying on the default options. This passage is self-translating

Jquery.cookie plug-in official and use method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.