' Localstorage ': Localdata = {hname:location.hostname? location.hostname+ '/marchsoft/index.php/oa/': ' Localstatus ', IsLocalStorage:window.localStorage? True:false,datadom:null,initdom:function () {//Initialize Userdataif (!this.datadom) {try{this.datadom = Document.createelement (' input ');//use hidden INPUT element this.dataDom.type = ' hidden '; this.dataDom.style.display = " None "; This.dataDom.addBehavior (' #default #userdata ');//This is UserData syntax Document.body.appendChild (this.datadom); var Exdate = new Date (), exdate = Exdate.getdate () +30;this.datadom.expires = exdate.toutcstring ();//Set Expiration Time}catch (ex) { return false;}} Return True;},set:function (Key,value) {if (this.islocalstorage) {Window.localStorage.setItem (key,value);} Else{if (This.initdom ()) {this.dataDom.load (this.hname); This.dataDom.setAttribute (Key,value); This.dataDom.save ( This.hname)}}},get:function (key) {if (this.islocalstorage) {return Window.localStorage.getItem (key);} Else{if (This.initdom ()) {this.dataDom.load (this.hname); return This.dataDom.getAttribute(key);}}},add:function (Key,value) {var before = This.get (key); if (before! = null) {var add = true; var i = 0; for (i;i<b Efore.length;++i) {if (value = = This.get (key) [i]) {add = false;}} if (add) {This.set (key,new Array (This.get (key), value)); }}else{This.set (key,new Array (value)),}},remove:function (key) {if (this.islocalstorage) {Localstorage.removeitem ( key);} Else{if (This.initdom ()) {this.dataDom.load (this.hname); This.dataDom.removeAttribute (key); This.dataDom.save ( this.hname);}}}
JavaScript js a solution for saving data locally: Localstorage