Javascript to add cdata section on the fly?

前端 未结 2 603
太阳男子
太阳男子 2021-01-24 17:54

I\'m having trouble with special characters that exist in an xml node attribute. To combat this, I\'m trying to render the attributes as child nodes and, where necessary, using

2条回答
  •  情书的邮戳
    2021-01-24 18:20

    Not sure of browser support for document.implementation.createDocument or createCDataSection, but this works in Mozilla at least:

    
    

提交回复
热议问题