Rasmikant Rasmikant - 3 months ago 31
HTML Question

Write html string in json

Is it possible write a HTMLstring inside JSON ?

Which I want to write like below in my json file

[
{
"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>"
}
]

Answer

You should escape the characters like double quotes in the html string by adding "\"

eg: <h2 class=\"fg-white\">

Comments