View Full Version : [resolved] Desperate AJAX question

11-22-2007, 04:40 PM
I didn't figure out what was wrong with my code, but I found a different script that works. Still, if anyone can tell me my error here, it would be appreciated!

AUUUUUGH! I've been working on this simple script FOREVER and I finally got it work but then something happened on my computer and I lost it and now I have to start over. And now I'm lost on the simplest part of it! :mad: :mad:

external JS:

var xmlDoc; //pass a variable to be used later
if (window.ActiveXObject) // Code for IE:
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.load("forum.xml"); // Path to the forum

else if (document.implementation && document.implementation.createDocument) // code for Mozilla, Firefox,

Opera, etc.
xmlDoc.load("forum.xml"); // Path to the forum
alert('Browser error!\nYour browser is too old for this forum to parse the database.\nTo fix this

problem, upgrade to a new browser.'); //Message if browser doesnt support AJAX


<script src="func.js">
<form name="register">
Username: <input type="text" value="admin" name="username"><br>
Password: <input type="password" value="admin" name="password"><br>
Password Verification: <input type="password" value="admin" name="passwordVerification"><br>

XML file forum.xml:

<?xml version="1.0" encoding="UTF-8"?>
<excalo users="hello there">

I'm just trying to get an alert with the value of the users attribute. I've rewritten this code sooo much trying to get it to work, I think my mind is numb and is probably a simply solution but I just can't figure it out! :o

The error I'm getting in firefox is:
xmlDoc.getElementsByTagName("excalo")[0] has no properties The same thing happens when I try to get an alert of the "tester" element. Except, it says
xmlDoc.getElementsByTagName("tester")[0] has no properties UUUGH!