Home > Web Front-end > JS Tutorial > body text

Focus on analyzing and answering js and el expression operation list

亚连
Release: 2018-05-17 10:49:18
Original
2089 people have browsed it

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);  
                    }  
                }  
            }
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template