당신은 단순히 HTML5 로컬 스토리지 메커니즘을 사용하여 요청하는 경우 내가 jQuery를, 스프링 MVC를 사용하고
... 예를 들어이 필요합니다.
.height()
, .innerHeight()
또는 outerHeight()
은 필요한 것을 기반으로 사용할 수 있습니다. 여기
는 예입니다 -
jsfiddle.net/xK0nB1n
JQuery와
if(localStorage.divheight) //extract the old height
{
// handle the height as you want here
alert('Old height from local storage: '+ localStorage.divheight);
}
//Code just to show the mechanism of LocalStorage
$(document).ready(function(){
$('#result').click (function() {
//Remember the height
localStorage.divheight = $("div").height();
//Tell the user the freshly stored height
alert("New height: "+localStorage.divheight);
});
});
HTML
<div id="result">
Some number of lines here....
Lorem ipsum dolor sit amet, consectetur adipisicing elit
. Fuga earum id fugit veritatis! Pariatur, magni.
</div>
[웹 저장소] (http://dev.w3.org/html5/webstorage/)를보십시오. http://www.html5rocks.com/en/features/storage ♦ https://developer.mozilla.org/en/docs/Web/Guide/API/DOM/Storage –