Skip to content

Commit b34aebd

Browse files
committed
some more tweaks for the readme
1 parent 5de116f commit b34aebd

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

‎README.rdoc‎

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,33 @@
22

33
A simple, lightweight jQuery plugin for reading, writing and deleting cookies.
44

5+
== Installation
6+
7+
Include script *after* the jQuery library (unless you are packaging scripts somehow else):
8+
9+
<script src="/path/to/jquery.cookie.js"></script>
10+
511
== Usage
612

7-
// Create session cookie...
13+
Create session cookie:
14+
815
$.cookie('the_cookie', 'the_value');
916

10-
// Create expiring cookie, 7 days from then...
17+
Create expiring cookie, 7 days from then:
18+
1119
$.cookie('the_cookie', 'the_value', { expires: 7 });
1220

13-
// Create expiring cookie, valid across entire page...
21+
Create expiring cookie, valid across entire page:
22+
1423
$.cookie('the_cookie', 'the_value', { expires: 7, path: '/' });
1524

16-
// Read cookie...
25+
Read cookie:
26+
1727
$.cookie('the_cookie'); // => 'the_value'
1828
$.cookie('not_existing'); // => null
1929

20-
// Delete cookie by passing null as value...
30+
Delete cookie by passing null as value:
31+
2132
$.cookie('the_cookie', null);
2233

2334
== Options
@@ -47,6 +58,8 @@ Default: +false+. If true, the cookie transmission requires a secure protocol (h
4758
Default: +false+. By default the cookie is encoded/decoded when creating/reading, using +encodeURIComponent+/+decodeURIComponent+.
4859
Turn off by setting +raw: true+.
4960

61+
== Changelog
62+
5063
== Development
5164

5265
- Source hosted at {GitHub}[https://github.com/carhartl/jquery-cookie]

0 commit comments

Comments
 (0)