Storing HTML or XML code in javascript variables

前端 未结 4 1580
悲&欢浪女
悲&欢浪女 2021-01-21 14:16

I\'d like to store a some HTML/XML markups in a javascript variable. The problem is that the text is relatively large. For example how can I store the following XML piece in a j

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-21 15:04

    I recommend you use JSON, matey. It is less verbose. And javascript has methods to handle it nicely. In case you need to work with XML later in your classes, you can write a simple adapter.

提交回复
热议问题