웹프로그래밍

Global It Leader!!


jQuery


 
 

localStorage를 이용하여 데이터 저장/불러오기

페이지 정보

작성자 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 댓글 0건 조회 3,678회 작성일 16-06-24 11:42

본문

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
 
<button id="save">로컬저장소에 저장하기</button>
<button id="load">로컬저장소에서 불러오기</button>
 
<script type="text/javascript">
 
document.querySelector("#save").addEventListener("click", saveData, false);
document.querySelector("#load").addEventListener("click", loadData, false);

// 로컬저장소에 저장하기
function saveData(){
localStorage.setItem("item", "hello world");
}

// 로컬저장소에서 불러오기
function loadData(){
console.log( localStorage.getItem("item") );
}
</script>
</body>
</html>

댓글목록

등록된 댓글이 없습니다.

전체 149
게시물 검색
jQuery 목록
번호 제목 글쓴이 조회 날짜
149 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 83 12-27
148 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 189 11-08
147 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 211 07-31
146 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 205 06-20
145 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 197 06-20
144 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 199 06-05
143 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 202 06-05
142 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 686 07-06
141 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 881 01-05
140 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 986 12-07
139 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1500 03-31
138 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1506 03-28
137 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1506 03-27
136 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2220 03-27
135 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1469 03-27
134 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1555 03-27
133 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1861 03-26
132 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1499 03-26
131 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1695 03-26
130 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3247 03-26