HTML5 Web Storage API

window.sessionStorage.setItem("myKey","myValue");

window.sessionStorage.getItem("myKey");
sessionStorage的作用域只是在浏览(在构建它的窗口或标签有效)当中有效,用户关闭浏览器后失效
    try    {
if(!window.openDatabase){
alert('Not Supported cs-db');
}
else{
var shortName = 'noteDB';
var verson = '1.0';
var displayName = 'Note book database';
var db = openDatabase(shortName,verson,displayName,65536);
}
}
catch(e)
{
if(e == 2){
alert('Invalid database version,');
}
else
{
alert('Unknown error'+e+'.');
}
}


你可能感兴趣的:(html5)