JavaScript从sessionStorage获取数据
sessionStorage
在sessionStorage中设置数据的语法
sessionStorage.setItem();
Example
<html>
<body>
<p> id = "storage"</p>
<script>
if (typeof(Storage) !== "undefined") {
sessionStorage.setItem("product", "Tutorix");
document.getElementById("storage").innerHTML = sessionStorage.getItem("product");
}
else {
document.getElementById("storage").innerHTML = "Sorry,no Web Storage compatibility...";
}
</script>
</body>
</html>输出结果
Tutorix
热门推荐
8 祝福语简短古诗词
10 十月简短祝福语
11 公司春节祝福语和简短
12 周年蛋糕祝福语简短英语
13 对生活祝福语简短精辟
14 给表弟的祝福语简短
15 职场祝福语大全 简短精辟
16 佛教生日祝福语简短大全
17 周末思念祝福语大全简短
18 别人生辰祝福语简短