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(); }