Embedding JSON objects in script tags

前端 未结 4 1472
情深已故
情深已故 2020-12-06 09:33

EDIT: For future reference, I\'m using non-xhtml content type definition

I\'m creating a website using Django, and I\'m trying to embed ar

4条回答
  •  我在风中等你
    2020-12-06 10:10

    If you are using XHTML, you would be able to use entity references (<, >, &) to escape any string you want within . There are also arcane rules to allow (the comments and to be passed through). The compromise that the HTML5 editors adopted for future browsers is described in HTML 5 tokenization and CDATA Escapes

    I think the takeaway is that you must prevent from occurring in your JSON, and to be safe you should also avoid

提交回复
热议问题