0
如何使用jQuery制作本地网络存储,当访问我的网络时,数字会上升,如下面的示例所示?jQuery本地网络存储
<!DOCTYPE HTML>
<script type="text/javascript">
if(localStorage.hits){
localStorage.hits = Number(localStorage.hits) +1;
}
else{
localStorage.hits = 1;
}
document.write("Total Hits :" + localStorage.hits);
</script>
<p>Refresh the page to increase number of hits.</p>
<p>Close the window and open it again and check the result.</p>