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

  • Home
  • SEARCH
  • 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 6844341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:21:53+00:00 2026-05-27T00:21:53+00:00

For some reason, I keep getting XMLDoc is null, in firebug. I think that

  • 0

For some reason, I keep getting XMLDoc is null, in firebug. I think that perhaps my program isn’t parsing the XML that I am trying to generate (and that means I am likely not doing it correctly).

NOTE: I DO NOT WANT TO USE JQUERY HERE!

Here’s my code that is supposed to generate the XML code:

<?php
$con = mysql_connect("localhost", "root", "");
if (!$con)
{
    die('Could not connect: ' . mysql_error());
}
mysql_select_db("generic");
$rescult = mysql_query("SELECT * FROM culture order by cult_id");
if (!$rescult) {
    die('Invalid query: ' . mysql());
}
$row = mysql_fetch_row($rescult);
ECHO "<item>";
ECHO "<item1>" . $row[0] . "</item1>" . "<br />";
ECHO "<item2>" . $row[1] . "</item2>" . "<br />";
ECHO "</item>";
?>

And here’s my code that is supposed to parse it:

<html>
<header>
<script type="text/javascript">

if (window.XMLHttpRequest)
{   // Code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp = new XMLHttpRequest();
}
else
{   
    // Code for IE6, IE5
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","testitout2.php",false);
xmlhttp.send();
xmlDoc = xmlhttp.responseXML;

document.getElementById("item1").value =
xmlDoc.getElementsByTagName("item1")[0].childNodes[0].nodeValue;

document.getElementById("item2").value =
xmlDoc.getElementsByTagName("item2")[0].childNodes[0].nodeValue;

</script>
</header>
    <body>
        <input type="text" id="item1">
        <input type="text" id="item2">
    </body>
</html>
  • 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-27T00:21:53+00:00Added an answer on May 27, 2026 at 12:21 am

    Edit: I didn’t notice the async flag. Guess my answer is irrelevant then.

    You are trying to access XML before it was even loaded.
    Set property onreadystatechange to xmlhttp:

     xmlhttp.onreadystatechange = onStateChange;
    
     function onStateChange() {
        if (xmlhttp.readyState != 4) return; //4 means doc is ready
        var xmlDoc = xmlhttp.responseXML;
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use MapClassLoader in autoload.php but for some reason I keep getting
For some reason I keep getting error C3861: '__typeof': identifier not found when I
Here's my code: x=0; for i=1:100 x=x+sqrt(((1/((((2*i)-2)^2)*(((2*i)+2)^2)))*16)+8); end For some reason I keep getting
For some reason, I keep getting a '1' for the file names with this
For some reason i keep getting the following error when i try to set
For some reason, I keep getting an empty folder called blog generated on my
For some reason, I keep getting the following errors in ErrorHandler.h why size function
For some reason the Windows command prompt is special in that you have to
Hello i am having some problems sending mails thoug my site. I keep getting
i keep getting NullPointerException on this line: SharedPreferences myPreference = PreferenceManager.getDefaultSharedPreferences(this); i ran some

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.