logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > Javascript and JS frameworks
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 05-23-2010, 08:13 AM   #1
confused
 
Join Date: May 2010
Posts: 4
Default MSXML2 DOMDocument

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.
Thanks

Code:
    
var xmlDoc = new ActiveXObject("MSXML2.DOMDocument.3.0"); 
    xmlDoc.async="false";
    xmlDoc.load("../SaleData/ForSale.XML");        
    var items=xmlDoc.documentElement;
confused is offline   Reply With Quote
Old 05-24-2010, 07:38 AM   #2
ranjan
 
Join Date: Dec 2004
Posts: 405
Default A few clarifications

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
ranjan is offline   Reply With Quote
Old 05-24-2010, 01:03 PM   #3
confused
 
Join Date: May 2010
Posts: 4
Default

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.
confused is offline   Reply With Quote
Old 05-25-2010, 12:14 AM   #4
ranjan
 
Join Date: Dec 2004
Posts: 405
Default Ajax!

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/tutor...ng-with-jquery (with jQuery)
ranjan is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:10 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com