zoukankan      html  css  js  c++  java
  • js 中使用el表达式 关键总结:在js中使用el表达式一定要加双引号

    Java代码  收藏代码
    1. var selected = ${requestScope.xxxxForm.recordNumPerPage}  
    这样始终js错误,因为在第一次的时候requestScope.xxxxForm.recordNumPerPage为null。于是在boss的指导下,简单的加了两个引号,代码变成
    Java代码  收藏代码
    1. var selected = ${requestScope.xxxxForm.recordNumPerPage}”  
    ok,功能自动实现。 
    附上整个函数代码:
    Java代码  收藏代码
    1. function getSelected(name){  
    2.   var selects = document.getElementsByName(name);  
    3.   var selected =  “${requestScope.xxxxForm.recordNumPerPage}";  
    4.   if(selected == undefined || selected == null || selected ==""){  
    5.     return false;  
    6.   }  
    7.   for(var j = 0; j < selects.length; j++ ){  
    8.      for(var i = 0; i = selects[j].length; i++){  
    9.        if(selects[j].options[i].value == selected){  
    10.          selects[j].options[i].selectd = true;  
    11.        }   
    12.      }  
    13.   }       
    14. }  


    关键总结:在js中使用el表达式一定要使用双引号

  • 相关阅读:
    【剑指Offer】34、第一个只出现一次的字符
    【剑指Offer】33、丑数
    【剑指Offer】32、把数组排成最小的数
    linux精彩收集
    shell-总结【摘录】
    linux -特殊符号
    linux --mount
    linux--lsof
    linux--find
    Linux之rsync数据同步服务
  • 原文地址:https://www.cnblogs.com/jpfss/p/9155876.html
Copyright © 2011-2022 走看看