View Full Version : MSXML2 DOMDocument

05-23-2010, 08:13 AM
I know there is probably a realy simple solution to this question however I can not seem to find it on the net.

Basicly I have a XML doc that I want to read in via javascript however, when running the js in a debugger i always errors (steps out) on the
var xmlDoc = new ActiveXObject("MSXML2.DOMDocument.3.0"); line.

I really have no idea why. any help would be apprciated.

var xmlDoc = new ActiveXObject("MSXML2.DOMDocument.3.0");
var items=xmlDoc.documentElement;

05-24-2010, 07:38 AM
1. Are you looking for a cross browser solution ( your code would work only in IE )
2. Have you considered XMLHttpRequest instead of loading xml using .load
3. What is the exact error

05-24-2010, 01:03 PM
Yeah was running it in Firefox, what was confusing was the fact it worked nicely in dirty IE. Dont really know anything about XMLHttpReques, tbh im learning as i go about parsing XML all kinda new for me.

05-25-2010, 12:14 AM
Simply put XMLHttpRequest is a javascript method (function) that does pretty much what its called. It requests and loads an XML (and text) document requested over the http protocol.

Usual http request generally refresh the page after getting a response, with XMLHttpRequest the page doesn't need to refresh, hence this is the base function on which AJAX works.

To learn more about loading and parsing XML using AJAX please see

1. http://www.webpasties.com/xmlHttpRequest/ (pure javascript)
2. http://www.switchonthecode.com/tutorials/xml-parsing-with-jquery (with jQuery)