编辑器实时保存内容
2019獨角獸企業重金招聘Python工程師標準>>>
var?editor?=?$('.xheditor').xheditor({tools:'mini'});setInterval('save()',3000);function?save(){setTimeout('saveData("info",editor[0].getSource())',3000);setTimeout('saveData("features",editor[1].getSource())',3000);setTimeout('saveData("other",editor[2].getSource())',3000);}var?PwStorage?=?{save?:?function(key,?value,?force)?{if?(window.ActiveXObject)?{with(document.documentElement)?try?{load(key);setAttribute("value",?value);save(key);}?catch(e)?{return?false;}}?else?if?(window.sessionStorage)?{try?{sessionStorage.setItem(key,value);}?catch(e)?{return?false;}}return?true;},load?:?function(key)?{var?msg?=?'';if?(window.ActiveXObject)?{with?(document.documentElement)?try?{load(key);msg?=?getAttribute("value");}?catch(e)?{}}?else?if?(window.sessionStorage)?{try?{msg?=?sessionStorage.getItem(key);}?catch(e)?{}}?else?{return?false;}return?msg;},}function?saveData(key,?value){PwStorage.save(key,?value);}var?msg1?=?PwStorage.load('info');var?msg2?=?PwStorage.load('features');var?msg3?=?PwStorage.load('other');editor[0].setSource(msg1);editor[1].setSource(msg2);editor[2].setSource(msg3);轉載于:https://my.oschina.net/u/947558/blog/277596
總結
- 上一篇: mysql数据库query cache
- 下一篇: bash脚本编程之一 条件判断及算术运算