6
使用下劃線模板時,我想插在錨的href屬性值一樣如何在javascript下劃線模板中跳轉<>?
a(href= "<%= id %>", class='products') //underscore template in jade
但出來說就是
<a href="<% id %>" class="products">
所以如何躲避<和>符號,並插值值是否正確?
使用下劃線模板時,我想插在錨的href屬性值一樣如何在javascript下劃線模板中跳轉<>?
a(href= "<%= id %>", class='products') //underscore template in jade
但出來說就是
<a href="<% id %>" class="products">
所以如何躲避<和>符號,並插值值是否正確?
使用!=而不是= unescape。
你的情況:
a.products(href!="<%= id %>")
你真的說到做到這一點:一個(HREF = 「<%= id %>」 的class = '產品') – ddb
是的,我真的需要這種 – paynestrike
@chenliang,你能提供更多詳情?你想要的不是有效的HTML。 – Brad