一尘不染

用JSON编写HTML字符串

json

是否可以在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>"
    }
]

阅读 273

收藏
2020-07-27

共1个答案

一尘不染

您应该在HTML字符串中通过添加“ ** ” 来转义双引号等字符

例如: <h2 class=\"fg-white\">

2020-07-27