티스토리 뷰
function setCookie(name, value, expiredays) {
var todayDate = new Date();
// expire default 1 year
if (expiredays == null){
expiredays = 365;
}
todayDate.setDate( todayDate.getDate() + expiredays );
document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function getCookie(name){
var nameOfCookie = name + "=";
var x = 0;
while ( x <= document.cookie.length ){
var y = (x+nameOfCookie.length);
if ( document.cookie.substring( x, y ) == nameOfCookie ) {
if ((endOfCookie=document.cookie.indexOf( ";", y )) == -1 ){
endOfCookie = document.cookie.length;
}
return unescape( document.cookie.substring( y, endOfCookie ) );
}
x = document.cookie.indexOf( " ", x ) + 1;
if ( x == 0 )
break;
}
return "";
}
function deleteCookie(name){
var today = new Date();
var value = getCookie(name);
document.cookie = name + '=' + escape(value) + ';expires=' + today.toGMTString() + ';path=/;';
}
'Javascript' 카테고리의 다른 글
textarea 동적으로 resizing 하기 (1) | 2018.07.20 |
---|---|
간단하게 날짜 포맷 변경해보기 (0) | 2018.06.20 |
history.pushState 사용하기 (0) | 2017.07.07 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- Closure
- AVKit
- Coordinator
- xib
- m3u8
- HLS
- UIControl
- IOS
- UIButton
- Cleancode
- pagingView
- carousel
- Realm
- UIBarButtonItem
- NIB
- RECORDING
- customAlertView
- Swift
- ssh
- http live streaming
- Video
- AssociatedObject
- permission error
- database
- TDD
- testing
- Design Pattern
- CollectionView
- AVFoundation
- BaseViewController
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
글 보관함