1.cookie中设置值
<script type="text/javascript"> // 设置样式 function setCssFile(id){ //switchSkin(id); $("#cssfile").attr("href","css/"+ id +".css"); //设置不同皮肤 try{ $(window.parent.frames['main'].document) .find("#cssfile").attr("href","css/"+ id +".css"); $(window.parent.frames['leftFrame'].document) .find("#cssfile").attr("href","css/"+ id +".css"); $(window.parent.frames['midFrame'].document) .find("#cssfile").attr("href","css/"+ id +".css"); }catch(e){ } $.cookie( "b2cPlatform" , id , { path: '/', expires: 10 }); //cookie中设置 } </script>
2.EL读取cookie中的值
<link href="<%=path %>/css/${cookie.b2cPlatform.value==null?
'jf_blue':cookie.b2cPlatform.value}.css" rel="stylesheet" type="text/css" id="cssfile" />