abdolence / x2js

x2js - XML to JSON and back for JavaScript
1.01k stars 492 forks source link

IE11 X2JS undefined #44

Open estradamarkie opened 7 years ago

estradamarkie commented 7 years ago

For some reason var x2js = new X2JS() is failing on IE, it keeps giving X2JS is undefined

I tried doing an ajax call to my API which returns a JSON and trying to convert it to XML, this is working okay on other browsers except IE 11.

This is what I'm trying to do. $.get(apiUrlPath) .then(function (data) { var x2js = new X2JS(); var json2XMLResult = x2js.json2xml_str(data); console.log(data, json2XMLResult) })

Any ideas why its failing on IE11, although the jsfiddle example seems to be okay on IE.

I've put this in my index.html <script src="https://cdn.rawgit.com/abdmob/x2js/master/xml2json.js"></script>