473,320 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Page load delays

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

Jun 6 '07 #1
3 2698
The alMIGHTY N wrote:
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.
That's a browser behavior issue, or perhaps a scripting issue, not an
XML/XSL issue. There's no reason a browser couldn't start showing the
page immediately and then correct it; the question is why your browser
has decided not to do so, whether there's any way to change its mind,
and whether that solution is at all portable.

The traditional HTML solution, of course, would be to divide the problem
-- move the array into a separately loaded document.
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Jun 6 '07 #2
On Jun 6, 7:43 pm, Joe Kesselman <keshlam-nos...@comcast.netwrote:
The alMIGHTY N wrote:
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.

That's a browser behavior issue, or perhaps a scripting issue, not an
XML/XSL issue. There's no reason a browser couldn't start showing the
page immediately and then correct it;
If the XML document is really big, wouldn't that cause some sort of
delay in the loading of the page?

XML needs to be well-formed, right? How would the parser verify the
document is well-formed if it doesn't go through the whole thing
first?

My thought was that first the browser gets the XSL file, which in turn
gets the XML document. The XML document is big so it has to load all
of that first, then it goes through and runs the XSL transformations
on it. Part of those transformations include building the Javascript
array.

Once it loads up the whole XML document and verifies that it's well-
formed, it can start displaying the page as the XSL performs its
transformations.

I don't think it's getting caught on the XSL... I think it's getting
caught on loading the XML.

Of course, I'm not even close to an expert on XML or XSL so I may not
have an understanding of how it all works.
the question is why your browser
has decided not to do so, whether there's any way to change its mind,
and whether that solution is at all portable.

The traditional HTML solution, of course, would be to divide the problem
-- move the array into a separately loaded document.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Jun 13 '07 #3
The alMIGHTY N wrote:
If the XML document is really big, wouldn't that cause some sort of
delay in the loading of the page?
Depends on how it's being processed.
XML needs to be well-formed, right? How would the parser verify the
document is well-formed if it doesn't go through the whole thing
first?
Depends on how it's being processed. The application could begin
rendering, then stop and flag an error when the problem is encountered,
and recover in some reasonable way. This is an application design issue,
and in your case involves details of exactly how the XSLT processor and
browser have been written and configured.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Jun 13 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Quick Function | last post by:
Hi, I developed a site and used css. I put almost all style information in the css and used a lot of "id=my_css_class" in the html. They is little style specification in the html. I found that on...
5
by: bissatch | last post by:
Hi, I have been trying to come up with an idea to reduce double submissions where a user clicks refresh and, for example, another row is INSERT into a table. Originally, I would have a form...
3
by: usenet | last post by:
Hi All, I have some initialization to be done at page load time, which changes the text of some anchors so that they are consistent with the query string (these anchors are used as criteria...
1
by: Jason Shohet | last post by:
Someone in my group created an aspx with 12 tables on it, each with several rows in the table. In codebehind, we often make 1 or more tables visible / invisible. (However within each table, there...
1
by: Mariella Bakker | last post by:
Hi All, In an ASP.NET project I am trying to improve performance. As it is now there seems to be a huge bottleneck between the end of the Page.PreRender event and the beginning of the...
1
by: todd.roat | last post by:
I have something on our sites that seems to be causing 3 delay/hang symptoms: 1) Really slow load times 2) Once loaded, even if fast, eventually it locks up 3) defined slow loads where it says...
5
by: vijay | last post by:
Is there a way using javascript (or anything else) to know where the users go after they leave my page? Like "Do you want to navigate away ..." does a good job of alerting people no matter how they...
7
by: seanmatthewwalsh | last post by:
Hi I have a page (default.aspx) that pulls it's HTML from a database. I then have a "content management" page (editpage.aspx) that allows the user to edit the HTML in the database. When the...
2
by: Flark | last post by:
Hi folks, With my website, I am seeing a delay before the page appears in Firefox. My hosting service is Wild West Domains. 6 months ago I optimized the PHP code and it was loading in 1-2...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.