By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,340 Members | 1,715 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,340 IT Pros & Developers. It's quick & easy.

XML parsing, IE vs Mozilla

dmjpro
100+
P: 2,476
In Mozilla simply it calls the file URI using Ajax.
And in IE it calls the URI using something else.

Please have a look at this code ...

Expand|Select|Wrap|Line Numbers
  1. function loadXMLDoc(dname)
  2. {
  3. var xmlDoc;
  4. if (window.XMLHttpRequest)
  5.   {
  6.   xmlDoc=new window.XMLHttpRequest();
  7.   xmlDoc.open("GET",dname,false);
  8.   xmlDoc.send("");
  9.   return xmlDoc.responseXML;
  10.   }
  11. // IE 5 and IE 6
  12. else if (ActiveXObject("Microsoft.XMLDOM"))
  13.   {
  14.   xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  15.   xmlDoc.async=false;
  16.   xmlDoc.load(dname);
  17.   return xmlDoc;
  18.   }
  19. alert("Error loading document");
  20. return null;
  21. }
  22.  
In IE can't it be called using Ajax?
May 19 '09 #1
Share this Question
Share on Google+
11 Replies


Dormilich
Expert Mod 5K+
P: 8,639
I'm not sure but you're not doing an AJAX call with IE, do you?
May 19 '09 #2

dmjpro
100+
P: 2,476
@Dormilich
Simply i copied the code from W3C (DOM parsing) and pasted here.
I just wanted to know is it possible to DO Ajax call in IE?
May 19 '09 #3

Dormilich
Expert Mod 5K+
P: 8,639
could you link to that page, where the example is?
May 19 '09 #4

dmjpro
100+
P: 2,476
I have a look at this ...
I could have also tested out .. this is my bad habit :P
May 19 '09 #5

Dormilich
Expert Mod 5K+
P: 8,639
what you have there is not supposed to be AJAX, but loading an XML file. the XMLHttpRequest object is used to open the file, except for IE.

btw, w3schools is not W3C
May 19 '09 #6

dmjpro
100+
P: 2,476
@Dormilich
Why it is not supposed to be an Ajax call?

@Dormilich
Opps!
May 19 '09 #7

Dormilich
Expert Mod 5K+
P: 8,639
@dmjpro
because it's not (intended to be) asnycronous.

in this case for IE the XMLDOM ActiveX control is used, because it is sufficient for loading an XML file.

the AJAX tutorial is here.
May 19 '09 #8

dmjpro
100+
P: 2,476
@Dormilich
Oh! Ajax can't be Synchronous? Then what Ajax means ? lolz!
Well in that sense you told it it's not Ajax.
So what IE provides here .. which one is first in IE?
May 19 '09 #9

Dormilich
Expert Mod 5K+
P: 8,639
@dmjpro
it can be.

but just loading an XML file doesn't require asyncronous access, thus IE uses it's XML parser, which is not asyncronous.
May 19 '09 #10

dmjpro
100+
P: 2,476
@dmjpro
Which one is *fast in IE as IE has two options?
Is there any DOM Parser in Mozilla as in IE?
May 20 '09 #11

Dormilich
Expert Mod 5K+
P: 8,639
@dmjpro
if you want AJAX, then there is only one.

@dmjpro
why? once you have the document tree loaded, you can use Javascript as you know it.
May 20 '09 #12

Post your reply

Sign in to post your reply or Sign up for a free account.