//写cookie function kkk(objvalue) { var str = 'xx' + "=" + escape(objvalue); //编码 // if (objhours > 0) {//为0时不设定过期时间,浏览器关闭时cookie自动消失 // var date = new date(); // var ms = objhours * 3600 * 1000; // date.settime(date.gettime() + ms); // str += "; expires=" + date.togmtstring(); // } document.cookie = str; } function qkkk(key) { localstorage.getitem('xx') //取出缓存 }