Re: manipulate xml that supports both IE and Mozilla
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: manipulate xml that supports both IE and Mozilla

From: Andrew Scott <Andrew@compan.net>
Date: Tue Jun 14 2005 - 10:52:06 CEST

jrefactors@hotmail.com wrote:
> I want to use javascript to manipulate XML files.
>
> The following code works in IE but it won't work in Mozilla.
> var xml = new ActiveXObject("Microsoft.XMLDOM");
>
> Any way to make it work in cross browsers?
>
> please advise. thanks!!
>

Hi

XMLHttpRequest is what you are after.

------------ SAMPLE CODE -------------
var xml;
try { xml = new XMLHttpRequest();}
catch (e) { xml = new ActiveXObject("Microsoft.XMLHTTP"); }

--------------------------------------

With these you can use POST and GET to retrive XML from a server.

HTH's

Andy
Received on Tue Oct 18 02:44:26 2005