Home  >  Article  >  Web Front-end  >  Focus on analyzing and answering js and el expression operation list

Focus on analyzing and answering js and el expression operation list

亚连
亚连Original
2018-05-17 10:49:182091browse

is showing a list table, and the data in the table comes from a list, and the fields in the entity class in the list are taken from the dictionary table Therefore, values ​​such as 0 and 1 are stored. Since text needs to be displayed during display, I wrote a comparison method

[html] view plain copy
var len='${fn:length(products.detailList)}';  
            for(var index=0;index<len;index++){  
                var singleunit=&#39;${products.detailList[""+index+""].supply.singleunit}&#39;;  
                for(var u=0;u<dictlist.length;u++){  
                    var value=dictlist[u].value;  
                    var label=dictlist[u].label;  
                    if(singleunit==value){  
                        $("#specunit"+index+"").html(label);  
                    }  
                }  
            }

Haha, pay attention to the double quotes there. I struggled for several hours and even thought of changing my mind. Later, I thought of jquery connecting variables, and I was instantly inspired, and the result was great.

The above is a list of js and el expression operations that I compiled for everyone. I hope it will be helpful to everyone in the future.

Related articles:

Detailed introduction to the use of EL expressions in JS

How to pass two parameters to JS onclick Specific steps of JS method

Detailed explanation of JS rewriting prototype object

The above is the detailed content of Focus on analyzing and answering js and el expression operation list. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn