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 7574943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:33:43+00:00 2026-05-30T16:33:43+00:00

* SOLVED * Answer is in separate post below This code runs fine in

  • 0

* SOLVED * Answer is in separate post below

This code runs fine in FireFox but it will not run in Internet Explorer 8. It gives me the error of “access denied. Is there something I am missing?

function loadXMLDoc(dname){
    if (window.XMLHttpRequest){
        var xhttp=new XMLHttpRequest();
    }
    else{
        var xhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xhttp.open("GET", dname,false);
    xhttp.send();
    return xhttp.responseXML;
}
var xmlDoc=loadXMLDoc("notSchema.xml");
var x=xmlDoc.getElementsByTagName('ROOT_NODE_ID');

It specifically doesn’t like the .open() and the .send()

Edited…

var x;

function loadXMLDoc(dname){
var request = $.ajax({
    url: dname,
    type: "GET",
    async: false,
    data: {},
    success: function(http){
        xmlDoc = http;
        alert(http);
        x=http.getElementsByTagName("ROOT_NODE_ID");
    },
    error: function(html){
        alert('failure: ' + html);
    }       
});

}

loadXMLDoc("notSchema.xml");

for (var i=0;i<x.length;i++)
{

if(x[i].childNodes[0] == undefined) {
    treeArray[count]="null";
    count++;
}else{
    //return ROOT_NODE_ID

    treeArray[count]=x[i].childNodes[0].nodeValue;
    count++;
}
}

Edited the Code once again. What I’m trying to do is load the XML, parse for the tag “ROOT_NODE_ID” and then get that value and store it into an array

When I run that code in firefox, it returns 51, which is the number of ROOT_NODE_ID tags and fills the tree that I am making.
When I run the same exact code in IE8, it does not even alert.

I’m Stumped.

  • 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-05-30T16:33:45+00:00Added an answer on May 30, 2026 at 4:33 pm

    I figured it out. Like I said before, if you run the code above in Firefox, it returns the ‘object’ and if you run it in IE8, it returns the contents of the object. I solved this problem by loading the content of the object again in IE8, thus turning the content of the object back into an object that will be ready to be parsed. If that makes any sense.

    Just to clarify to people that are just visiting this thread. When I called ‘alert(http);’ in firefox, it would return ‘[object XMLDocument]’, but in IE8 it would return the actual contents of ‘[object XMLDocument]’.

    var treeArray=new Array();
    var count = 0;
    var x;
    
    function loadXMLDoc(dname){
    var request = $.ajax({
        url: dname,
        type: "GET",
        async: false,
        data: {},
        success: function(http){
            var xmlDocument = new ActiveXObject("Microsoft.XMLDOM");
            //Loading the contents of the object 'http' a second time, which turns it into an object again. 
            xmlDocument.loadXML(http);
            x = xmlDocument.getElementsByTagName("ROOT_NODE_ID");
            alert(x.length);
        },
        error: function(html){
            alert('failure: ' + html);
        }       
    });
    
    }
    
    loadXMLDoc("notSchema.xml");
    
    for (var i=0;i<x.length;i++)
    {
    
    if(x[i].childNodes[0] == undefined) {
        treeArray[count]="null";
        count++;
    }else{
        //return ROOT_NODE_ID
    
        treeArray[count]=x[i].childNodes[0].nodeValue;
        count++;
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Update: Solved, with code I got it working, see my answer below for the
Edit: I have solved this by myself. See my answer below I have set
UPDATE: Solved. Thanks BusyMark! EDIT: This is revised based on the answer below from
This problem must have been solved a million times, but Google has not been
Problem solved: Thanks guys, see my answer below. I have a website running in
The problem is not solved although I accepted one answer. Problem: Vim updates very
solved, see my FINAL ANSWER post for complete details on what worked for me
This question is very much related to: A) How to separate CUDA code into
Solved: see answer below I am sub-classing Dialog to create a dialog with a
SOLVED in the last answer im getting following error, dunno where and why? cause

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.