【发布时间】:2015-09-18 18:51:32
【问题描述】:
我有一个 Node JS 服务器查询 MongoDB,然后将返回结果渲染到 EJS 模板:res.render('graphFabric.ejs', {'iBeacons':[(beacon)]});.
当我尝试使用从我的模板中恢复 JSON 时
<%=iBeacons%>
, '(单引号)显示为&#39;
例如:udid: &#39;b9407f30f5f8466eaff925556b57fe6d&#39;,
由于它破坏了我的 JSON 结构,如何解决此问题?
【问题讨论】:
标签: javascript json node.js mongoose ejs