Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7834021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:00:56+00:00 2026-06-02T13:00:56+00:00

My question is totally focussed on Microsoft (Trident) browsers. What is the difference between

  • 0

My question is totally focussed on Microsoft (Trident) browsers. What is the difference between the reponseXML and loadXML ? Following two codes are shown:

way 1:

  var xmlObj = new ActiveXObject("Msxml2.DOMDocument");
    xmlObj.async = false;
    xmlObj.load('/files/xml/books.xml');

way 2:

var request = new ActiveXObject("Microsoft.XMLHTTP");
request.open("GET", "files/xml/books.xml", false);
request.onreadystatechange = function() { var xmlObj = request.responseXML; };
request.send(null);

In the above snippets, the variable xmlObj in both cases are xml documents. But is there any difference between them ? Because I was trying to do something without ajax calls,
by using the previous snippet but it didn’t work although the xmlObj had the xml file’s content as expected. Kindly help. Thanks.

EDIT :

I found a difference. Let us consider books.xml is:

<books>
  <book>
      <a/><b/>
  </book>
  <book>
      <a/><b/>
  </book>
</books>

Now xmlObj.getElementsByTagName(‘a’).length will return 2 for the second method (ajax call) and it will return 0 for the first method.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T13:00:57+00:00Added an answer on June 2, 2026 at 1:00 pm

    The only difference you may encounter between using those two APIs is the version of MSXML you’re dealing with as you’re specifying MSXML2 in one case but not in the other. In general you shouldn’t see any noticeable effects unless you’re doing a lot of XPath or XSLT.

    As for those particular code snippets, however, they are quite different. Although you’re specifying that the send() executes synchronously in way 2 the onreadystatechanged event will fire several times so you should also check for a request.readyState == 4 before grabbing the responseXML.

    That said, because it’s synchronous you don’t need to use onreadystatechanged at all as send() will only return once the request completes so you could then just grab request.responseXML on the following line.

    I should also mention, since you talked about invalid XML, that the error case in both methods is the same. Neither will throw an exception for invalid XML – you will get a non-zero xmlObj.parseError.errorCode value instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My question is simple: is there a way to totally automate the process to
I already read following question and answers. How to communicate between same application installed
Following on from this question , I'm totally stumped on getting LaTeX to give
My question is straight forward. I'm totally new to the Microsoft stack, I have
Totally n00b question, Im making my first ASP.NET website, with the added twist of
Totally a PHP noob here so sorry for the possibly basic question - here
Here's the question in brief: My blog posts at... http://www.seanbradley.biz/blog ...totally lacks formatting. They're
Question I have two compilers on my hardware C++ and C89 I'm thinking about
G'day, OK, I have now rewritten this question totally: I am trying to import
Ok, I am asking this question because I am totally confused. I used to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.