是否可以在 JSON 中写入 HTML 字符串?
我想在我的 JSON 文件中像下面这样写:
[
{
"id": "services.html",
"img": "img/SolutionInnerbananer.jpg",
"html": "<h2class="fg-white">AboutUs</h2><pclass="fg-white">developing and supporting complex IT solutions.Touchingmillions of lives world wide by bringing in innovative technology </p>"
}
]
最佳答案
您应该通过添加 "\"来转义 html 字符串中的双引号等字符
例如:<h2 class=\"fg-white\">
关于javascript - 在 JSON 中写入 HTML 字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22551586/