Create XML in Javascript

后端 未结 7 753
慢半拍i
慢半拍i 2020-11-28 07:16

I\'m wondering, is it possible to create an XML file with some data in Javascript? I have the data stored in variables.

I\'ve googled around a bit and it doesn\'t see

7条回答
  •  北海茫月
    2020-11-28 07:48

    Simply use

    var xmlString = '';
    var xml = jQuery.parseXML(xml);
    

    It's jQuery.parseXML, so no need to worry about cross-browser tricks. Use jQuery as like HTML, it's using the native XML engine.

提交回复
热议问题