Hiển thị các bài đăng có nhãn ejs template. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn ejs template. Hiển thị tất cả bài đăng

How to comment ejs code ( JS node)

 https://stackoverflow.com/questions/29180611/how-to-comment-ejs-code-js-node


There is two solutions:

  • <%# comment %> ( it's from documentation )
  • <%/* comment */%> ( it works too but it's pretty ugly and uncomfortable for use )

HTML select option with EJS

Source: https://stackoverflow.com/questions/34878180/html-select-option-with-ejs

You can put it in a loop based on the option values.
<select id="volume">

<%
var options = [ "1", "5", "10", "50", "75", "100" ];
for ( var i = 0; i < options.length; i++ )
{
    var selected = ( config[0].volume == i ) ? "selected" : "";
    %><option value="<%=options[ i ] %>" <%=selected %>><%=i %></option><%
}
%>
</select>

anti-pattern là gì

  Trong công nghệ và lập trình, Anti-pattern (mẫu phản diện) là những giải pháp bề ngoài có vẻ hiệu quả để giải quyết một vấn đề phổ biến, ...