jquery cookie

· 14년 전 · 5272 · 3

Installation

Include script after the jQuery library (unless you are packaging scripts somehow else):

<script src="/path/to/jquery.cookie.js"></script>

Usage

Create session cookie:

$.cookie('the_cookie', 'the_value');

Create expiring cookie, 7 days from then:

$.cookie('the_cookie', 'the_value', { expires: 7 });

Create expiring cookie, valid across entire page:

$.cookie('the_cookie', 'the_value', { expires: 7, path: '/' });

Read cookie:

$.cookie('the_cookie'); // => 'the_value'
$.cookie('not_existing'); // => null

Delete cookie by passing null as value:

$.cookie('the_cookie', null);
|

댓글 3개

오 쿠키 플러그 인이군요 간단하네요
흠..........
댓글을 작성하시려면 로그인이 필요합니다.

그누4 팁자료실

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요. 나누면 즐거움이 커집니다.

+
제목 글쓴이 날짜 조회
14년 전 조회 4,541
14년 전 조회 4,806
14년 전 조회 3,569
14년 전 조회 3,603
14년 전 조회 8,548
14년 전 조회 5,593
14년 전 조회 4,933
14년 전 조회 4,522
14년 전 조회 2.6만
14년 전 조회 5,273
14년 전 조회 9,009
14년 전 조회 3,822
14년 전 조회 7,592
14년 전 조회 4,596
14년 전 조회 4,641
14년 전 조회 5,209
14년 전 조회 4,266
14년 전 조회 3,137
14년 전 조회 4,000
14년 전 조회 6,918