XML parsing, IE vs Mozilla

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    XML parsing, IE vs Mozilla

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

    Code:
    function loadXMLDoc(dname)
    {
    var xmlDoc;
    if (window.XMLHttpRequest)
      {
      xmlDoc=new window.XMLHttpRequest();
      xmlDoc.open("GET",dname,false);
      xmlDoc.send("");
      return xmlDoc.responseXML;
      }
    // IE 5 and IE 6
    else if (ActiveXObject("Microsoft.XMLDOM"))
      {
      xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
      xmlDoc.async=false;
      xmlDoc.load(dname);
      return xmlDoc;
      }
    alert("Error loading document");
    return null;
    }
    In IE can't it be called using Ajax?
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    I'm not sure but you're not doing an AJAX call with IE, do you?

    Comment

    • dmjpro
      Top Contributor
      • Jan 2007
      • 2476

      #3
      Originally posted by Dormilich
      I'm not sure but you're not doing an AJAX call with IE, do you?
      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?

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        could you link to that page, where the example is?

        Comment

        • dmjpro
          Top Contributor
          • Jan 2007
          • 2476

          #5
          I have a look at this ...
          I could have also tested out .. this is my bad habit :P

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            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

            Comment

            • dmjpro
              Top Contributor
              • Jan 2007
              • 2476

              #7
              Originally posted by Dormilich
              what you have there is not supposed to be AJAX.
              Why it is not supposed to be an Ajax call?

              Originally posted by Dormilich
              btw, w3schools is not W3C
              Opps!

              Comment

              • Dormilich
                Recognized Expert Expert
                • Aug 2008
                • 8694

                #8
                Originally posted by dmjpro
                Why it is not supposed to be an Ajax call?
                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.

                Comment

                • dmjpro
                  Top Contributor
                  • Jan 2007
                  • 2476

                  #9
                  Originally posted by Dormilich
                  because it's not (intended to be) asnycronous.
                  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?

                  Comment

                  • Dormilich
                    Recognized Expert Expert
                    • Aug 2008
                    • 8694

                    #10
                    Originally posted by dmjpro
                    Ajax can't be Synchronous?
                    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.

                    Comment

                    • dmjpro
                      Top Contributor
                      • Jan 2007
                      • 2476

                      #11
                      Originally posted by dmjpro
                      which one is *first in IE?
                      Which one is *fast in IE as IE has two options?
                      Is there any DOM Parser in Mozilla as in IE?

                      Comment

                      • Dormilich
                        Recognized Expert Expert
                        • Aug 2008
                        • 8694

                        #12
                        Originally posted by dmjpro
                        Which one is *fast in IE as IE has two options?
                        if you want AJAX, then there is only one.

                        Originally posted by dmjpro
                        Is there any DOM Parser in Mozilla as in IE?
                        why? once you have the document tree loaded, you can use Javascript as you know it.

                        Comment

                        Working...