yesod中如何将Json转换为Html?
yesod-0.9.3 中是否有某种方法可以将 Json
转换为 Html
以将其包含到 标记中?
使用 Yesod.Json
和 Data.Aeson
我可以获得 Json
类型的值,我想将其用作变量的值在 标记中引入,即不返回
RepJson
,而是将其包含为 RepHtml
的一部分。
Is there some way in yesod-0.9.3 to convert Json
to Html
to include it into <script/>
tag?
Using Yesod.Json
and Data.Aeson
I can get the value of a Json
type, which I want to use as the value of a variable introduced in a <script>
tag, that is, not to return RepJson
, but to include it as a part of RepHtml
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用完全限定名称...
然后,在您的小村庄内:
请注意,这有点危险,因为它不会检查编码是否成功。有关详细信息,请参阅
Data.Text.Encoding
模块。Using fully qualified names...
then, inside your hamlet:
Note that this is a bit dangerous in that it doesn't check that the encoding was successful. Look at the
Data.Text.Encoding
module for more info.