Write HTML string in JSON

前端 未结 11 1446
小蘑菇
小蘑菇 2020-12-09 08:25

Is it possible to write an HTML string inside JSON?

Which I want to write like below in my JSON file:

[
    {
        \"id\": \"services.html\",
             


        
11条回答
  •  甜味超标
    2020-12-09 09:09

    You can, once you escape the HTML correctly. This page shows what needs to be done.

    If using PHP, you could use json_encode()

    Hope this helps :)

提交回复
热议问题