引入jquery.xml2json.js
//这只能将一个row转换成对象 var json = $.xml2json("<row><Year>2020</Year><Month>12</Month><Progress>12</Progress><Value>120.00</Value></row>"); //在外圈加上一个标签<index>(任意标签都行),可以转换成数组 var jsonList = $.xml2json("<index><row><Year>2020</Year><Month>12</Month><Progress>12</Progress><Value>120.00</Value></row></index>");