偶然看到一个项目,script标签里面嵌入html标签,没接触过这样的,哪位老哥解释一下这种...
<script type="text/itpl" id="tpl_readonly">
<div class="field_line">
<div class="field_key"><%=data.key%>:</div>
<div class="field_content readonly test">
<%if(data.type == 'text' || data.type == 'textarea'){%>
<span class="editable" dbk="<%=data.dbk%>"><%=data.html%></span>
<%}else{%>
<%=data.html%>
<%}%>
</div>
<div class="clear"></div>
</div>
</script>