Hi,
nick.taylor@gmail.com wrote:
Quote:
Hi,
I've been trying for weeks to figure out this problem. I'm developing a
simple Javascript app that loads an XML file from a server, parses the
contents, and displays them. But I am encountering a very mysterious
bug that I can't seem to get rid of.
>
When loading the page in Internet Explorer, everything works, and in
Firefox it works except for one problem: the page never stops loading.
The script runs and everything parses but it just keeps spinning.
<snip>
Quote:
function parseTOC() {
document.write("parsing....<br/>");
createTOC(xmlDoc.documentElement, 0); // My function -- it works
properly
document.write("<br/>parser terminated<br/>");
}
<snip>
Try closing the document when you're done writing to it,
function parseTOC() {
document.write("parsing....<br/>");
createTOC(xmlDoc.documentElement, 0);
document.write("<br/>parser terminated<br/>");
document.close();
}
Note that using document.write to do this kind of things is questionable
IMHO. I would rather use DIVs with IDs and then use DOM Level 2 methods
to get the specific nodes and write to them. This way has the advantage
of working even when the document is fully loaded, however it won't work
in old (Netscape 4) or thin (PDAs) browsers.
HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering:
http://www.galasoft-LB.ch
PhotoAlbum:
http://www.galasoft-LB.ch/pictures
Support children in Calcutta:
http://www.calcutta-espoir.ch