js 中使用el表达式 关键总结:在js中使用el表达式一定要加双引号
js控制中用到了el表达式,最开始源码如下:
- var selected = ${requestScope.xxxxForm.recordNumPerPage}
- var selected = “${requestScope.xxxxForm.recordNumPerPage}”
附上整个函数代码:
- function getSelected(name){
- var selects = document.getElementsByName(name);
- var selected = “${requestScope.xxxxForm.recordNumPerPage}";
- if(selected == undefined || selected == null || selected ==""){
- return false;
- }
- for(var j = 0; j < selects.length; j++ ){
- for(var i = 0; i = selects[j].length; i++){
- if(selects[j].options[i].value == selected){
- selects[j].options[i].selectd = true;
- }
- }
- }
- }
关键总结:在js中使用el表达式一定要使用双引号