我想提出一个API的调用返回类似于此:HTML标记解析JSON数据在JavaScript
{
node: {
16981: {
type: "story",
title: "The day I found a dollar",
body: "<p>Today i was going to the mall when I found a dollar</p><p>This wasn&39t just any dollar it was a magical dollar</p>
}
17005: {
type: "story",
title: "My Big Thanksgiving",
body: "<p>Thanksgiving has always been one of my favorite hollidays</p><p>My favorite part of thanks giving is eating all of the food. I really like food</p><p>This year I'm going to eat only turkey</p>
}
}
我可以访问数据没有问题,但是当我尝试添加的身体在页面的故事中它仍然有p-tags和奇怪的'&#039我相信这是一个撇号。我玩过JSON.stringify,但是如果我将整个响应串联起来,解析起来就非常困难。 (因为我修改了大部分数据以保持简洁)另外,如果仅对正文进行字符串化,则会返回相同的字符串。提前致谢。我将围绕回答问题。
您可以添加一个关于如何使用它的例子吗? – RageAgainstTheMachine