Cplexfrperfection
New Member
I am trying to find a right way to create XML document from responseText. How we will use "eval" here. eval on XML throws SyntaxError.\[code\]eval("<p>This is test</p>"); --> Will failsometimes responseText = "<DATA><static-route><route>0.0.0.0/0</route<nexthop>10.204.247.254</nexthop></static-route></DATA>"or responseText = "testing"parseData(resonseText)/*create XML Document from the data response */function parseData (dataSources) { try { var values = dataSources; if (window.ActiveXObject) IE = true; else if(document.implementation && document.implementation.createDocument) IE = false; if (IE) { var xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = "false"; xmlDoc.loadXML(values); //Do more things } else { **//values = eval('('+values+')');** //Throws SyntaxError var rpcParser = new DOMParser(); rpcDocument=rpcParser.parseFromString(values,"text/xml"); //Do more things } } catch (e) { //Reaches here if use eval function. }\[/code\]};Thanks,Vinni