T
The alMIGHTY N
I have an XSL file that works with a typically large XML data set
generated dynamically from a database. This data is written to the
HTML result as a deep multi-dimensional array that is used by
Javascript functions to build large expanding/collapsing tables to
display the data.
The original developer wrote the page so that many writeln functions
were called in embedded Javascript to actually write the table as the
page was loading. This caused Javascript to throw a "script running
too long" error because the the scripts would have to wait for the
array to finish coming into existence.
I thought it an obvious solution to put an empty DIV on the page
first, wait for the page to finish loading, then use the BODY tag
onload call to run Javascript functions that would reference the
arrays and build the table through the DOM. The page still takes a bit
of time to load but there's a noticeable increase in the performance.
Recently, I decided that I needed to include some sort of "loading"
message so that users don't wonder why the page sits there blank for
several seconds. I included a Javascript function designed to hide the
message as soon as the DOM functions finished.
When I tested this, I found out that the message, contained within an
H1 tag placed well before the XSL started building the arrays, would
not load until the tables were drawn. At first, the message would
never show. After I removed the function to hide it, the message
appeared when the tables appeared.
My theory is that none of the HTML result is being rendered to the
screen until the XSL has completed loading everything... and that the
still significant delay is the result of the XSL loading versus the
DOM manipulation.
So my question is whether there's a way to force the H1 tag to appear
on the screen without having to wait for the XSL to finish parsing all
the data into the multi-dimensional array, which is much further down
in the HTML result.
Thank you for taking the time to read this far!
Nathaniel
generated dynamically from a database. This data is written to the
HTML result as a deep multi-dimensional array that is used by
Javascript functions to build large expanding/collapsing tables to
display the data.
The original developer wrote the page so that many writeln functions
were called in embedded Javascript to actually write the table as the
page was loading. This caused Javascript to throw a "script running
too long" error because the the scripts would have to wait for the
array to finish coming into existence.
I thought it an obvious solution to put an empty DIV on the page
first, wait for the page to finish loading, then use the BODY tag
onload call to run Javascript functions that would reference the
arrays and build the table through the DOM. The page still takes a bit
of time to load but there's a noticeable increase in the performance.
Recently, I decided that I needed to include some sort of "loading"
message so that users don't wonder why the page sits there blank for
several seconds. I included a Javascript function designed to hide the
message as soon as the DOM functions finished.
When I tested this, I found out that the message, contained within an
H1 tag placed well before the XSL started building the arrays, would
not load until the tables were drawn. At first, the message would
never show. After I removed the function to hide it, the message
appeared when the tables appeared.
My theory is that none of the HTML result is being rendered to the
screen until the XSL has completed loading everything... and that the
still significant delay is the result of the XSL loading versus the
DOM manipulation.
So my question is whether there's a way to force the H1 tag to appear
on the screen without having to wait for the XSL to finish parsing all
the data into the multi-dimensional array, which is much further down
in the HTML result.
Thank you for taking the time to read this far!
Nathaniel