`

JSTL EL表达式读取cookie中的值

 
阅读更多

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" />
 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics