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