jsp页面中js中el表达式使用

jsp页面中js中不能使用el表达式,如若使用,应在body的onload中添加方法,同时

在body体中使用隐藏域,以EL表达式形式获取后台attribut中参数,然后在onload对应js中通过

document.getElementById()方法,获取属性进行操作;
// 根据渠道类型决定是否展示四级渠道
   function fourChannelFlag(){
       var roleID=document.getElementById('roleId').value;
       var levelId=document.getElementById('levelId').value;
       var chanelType=document.getElementById('chanelType').value;
       if(chanelType=="XB02" && roleID=="R14" && levelId=="C02"){
           $("#fourChannel").show();
           $("#fourChannel2").show();
   }else{
           $("#fourChannel").hide();
           $("#fourChannel2").hide();
   }

猜你喜欢

转载自blog.csdn.net/heng_yan/article/details/80845148