标签:log charset func url target jquery操作 tail 数据存储 on()
出处:http://blog.csdn.net/djzhao627/article/details/50747628
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" charset="utf-8" src="js/jquery.min.js"></script>
<script type="text/javascript">
// JS操作部分
localStorage.JSa="JSA";
document.write(localStorage.JSa);
localStorage.setItem(‘JSb‘,‘ JSB‘);
document.write(localStorage.getItem(‘JSb‘));
// JQuery操作部分
$(function(){
window.localStorage.JQa="JQA";
$("#a").text(window.localStorage.JQa);
window.localStorage.setItem(‘JQb‘,‘JQB‘);
$("#b").text(window.localStorage.getItem(‘JQb‘));
});
</script>
</head>
<body>
<p id="a"></p>
<p id="b"></p>
</body>
</html>
运行结果:
JQuery和JS操作LocalStorage/SessionStorage的方法(转)
标签:log charset func url target jquery操作 tail 数据存储 on()
原文地址:http://www.cnblogs.com/smileberry/p/7079655.html