Now I'm working on a web project. I need to create a XML document object using a given string buffer in JavaScript. I've successfully made it run smoothly on IE, but apparently I need to do some more work to improve its compatibility.
To help you understand my poor English, here is a tiny example describing what I want to express (Note, all in JavaScript) first of all, we have a string variable, say, "buffer", which has been obtained from the server and, in fact, it is formed like a XML:
"<Messages><Item>aaa</Item><Item>bbb</Item></Messages>"
Then, I can use the following code segment to create a IE-recognizable XML doc object:
var xmlDoc = new ActiveXObject("Microsoft.xmlDOM");
xmlDoc.async = false;
xmlDoc.loadXML(buffer);
And we've got it.
So, what I want to know is how to create an object considering browser compatibility(firefox, opera, etc) and whether the usages of it are same. Please help me!