請參考 Storage。
Storage
- 程式用法:
<script type='text/javascript'>
document.write( sessionStorage.bike
+'<br />'+ globalStorage['ant4js.blogspot.com'].bike );
sessionStorage.prt('早安');
</script> - 執行結果:
globalStorage
- 程式用法:
<script type='text/javascript'>
document.write(
globalStorage['ant4js.blogspot.com'].Game );
</script> - 執行結果:
localStorage
- 程式用法:
<script type='text/javascript'>
document.write( localStorage.Jolin );
</script> - 執行結果:
undefined
sessionStorage
- 程式用法:
<script type='text/javascript'>
document.write( sessionStorage.JAY );
</script> - 執行結果:
undefined