nodejs ejs 引号问题

来源:互联网 发布:江苏睿博数据 编辑:程序博客网 时间:2024/06/05 15:36

 var product={"id":1,"name":"3dddd\"","descs":"ccc","yprice":"15","stime":"100000000","total":"20","sold":"15","xprice":"10","ontime":10000000,"createtime":100000,"updatetime":100000,"model":0};

ejs格式输出:

 <%=product%>

结果:

 {&#34;id&#34;:1,&#34;name&#34;:&#34;3dddd\&#34;&#34;,&#34;descs&#34;:&#34;ccc&#34;,&#34;yprice&#34;:&#34;15&#34;,&#34;stime&#34;:&#34;100000000&#34;,&#34;total&#34;:&#34;20&#34;,&#34;sold&#34;:&#34;15&#34;,&#34;xprice&#34;:&#34;10&#34;,&#34;ontime&#34;:10000000,&#34;createtime&#34;:100000,&#34;updatetime&#34;:100000,&#34;model&#34;:0};

需要使用<%-product%>才正常。

0 0
原创粉丝点击