Web Storage 瀏覽器儲存
localStorage.setItem ( "firstKey", "firstData" );
localStorage.getItem ( "firstKey" );
// firstKey 為儲存項目的"鍵",firstData 為儲存項目的"值"
localStorage["firstKey"] = "firstData"; // "鍵"如同陣列的索引
var sValue = localStorage["firstKey"]; // 可用陣列方式取值
var sLength = localStorage.length; // 用length方法取得儲存項目的數量
var sKey = localStorage.key(i); // 可取用"鍵"的內容,i=0 ; sKey = "firstKey"
localStorage.remove(sKey); // 移除對應sKey的"鍵"與其所對應的"值"