Wood Dust Date: 2015-01-17
App-framework Learning--panel Value
About the AppFrameWork page value problem, many people ask, today here to give a few suggestions:
1. Local data access
/******** Local data access function *********/var localstorageutils = { setparam:function (name, value) { Localstorage.setitem (name, jsonutils.tostring (value)); }, getparam:function (name) { var obj = Localstorage.getitem (name); return Jsonutils.tojson (obj); }, removeparam:function (key) { return Localstorage.removeitem (key);} }
2.session data Access
<pre name= "Code" class= "JavaScript" >/******** <span style= "font-family:arial, Helvetica, Sans-serif;" >session data access function </span>*********/
var sessionstorageutils = {setparam:function (key, value) {Sessionstorage.setitem (key, Value)}, Getparam:function (Ke Y) {return Sessionstorage.getitem (key)}, Removeparam:function (key) {return Sessionstorage.removeitem (key);}}
3. By means of Data-value
<div id= "panelid" class= "Panel" ></>
Js:
var value = {A: "AAA", B: "BBB"};
Set up:
$ ("#panelID"). Data ("value", value);
Get
var DataSet = $ ("#panelID"). Data ("value");
Console.info (DataSet);
4. String interception etc...
App-framework Learning--panel Value