HTML and CSS Reference
In-Depth Information
var localStorage = window [ "localStorage" ] = {
"length" : 0 ,
"setItem" : function ( key , value ){
div . load ( attrKey );
key = cleanKey ( key );
if ( ! div . getAttribute ( key ) ){
this . length ++ ;
}
div . setAttribute ( key , value );
div . save ( attrKey );
},
"getItem" : function ( key ){
div . load ( attrKey );
key = cleanKey ( key );
return div . getAttribute ( key );
},
"removeItem" : function ( key ){
div . load ( attrKey );
key = cleanKey ( key );
div . removeAttribute ( key );
div . save ( attrKey );
this . length -- ;
if ( this . length < 0 ){
this . length = 0 ;
}
},
"clear" : function (){
div . load ( attrKey );
var i = 0 ;
while ( attr =
div . XMLDocument . documentElement . attributes [ i ++ ] ) {
div . removeAttribute ( attr . name );
}
div . save ( attrKey );
this . length = 0 ;
},
"key" : function ( key ){
div . load ( attrKey );
return
div . XMLDocument . documentElement . attributes [ key ];
}
},
// convert invalid characters to dashes
Search WWH ::




Custom Search