The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Problem with loading XML with JS

I am using JS to load nodes of an XML file into HTML div's. The code works perfectly in IE, but not in other browsers. In FF for instance I get the following error: relatedthought.getAttribute is not a function.

The XML file loads in all browsers, so I skip that part from repeating here. The important part of the code is the function quest(). It should fill a div#main with the value of the nodes named 'thought'. This works, but it should also fill certain div's with the values of nodes named 'child', 'parent' and 'jump'. And this does not work.
Here is the function quest():

Thanks for investigating, but i keep having this 'undefined' values too, when i use your script and my own files...So something is still wrong. If you would like to have another look then i could send you a zip with all the files...You can also look online on http://www.pantha.net/Old/JSbrain/index2.html

As for the undefined, if you look correctly, NameOfRelatedThought is looking in the Child Elements (<child id=56> ...) for a name Attribute, which is not present, so when you loop through and hit this line

If you wish to send me a zip file, please use Rapidshare.com, select browse, select the file and then upload. Once its complete you will see a link at the bottom saying "I don't want a collector's account right now. Just give me the download-link." click that and copy and paste both URLs into a PM for me.

I've found that the main Child links work fine on first click, but when the new data is shown, it takes two clicks.

As above I think its due to the a href actioning, and then the location.reload refreshing the old url for some reason. Does it not work without the location.reload? I can't test it at home for some reason.