Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Before pageload event

 
Promod kumar
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to hook into the event that is triggered before the page starts loading. Is this possible. Window.onload is executed after the page is loaded, so it is too late for what I am trying to do.
The sequence of events as I understand it
1) The bowser sends a request
2) The browser receives a reponse
3) The browser starts loading the page
4) The page is loaded
5) The browser executes onload event if it is connected

I am trying to hook into step 3 if possible. I have searched quite a bit and have not found much. Thanks for your help.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well adding a script tag to the page is called as the page is rendering.

What are you trying to accomplish exactly?


Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65228
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At what point are you trying to hook into? Before or after the DOM is constructed?
 
Promod kumar
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am troubleshooting an issue where our application hangs for about 20 minutes sporadically. Here is a partial html response which I got by doing view source.



I see line 1 printed in the log after 20 minutes of browser sending the request. Using app server logs and network logs, it is confirmed that the response does make it back to the workstation and the time taken is less than a minute. Our app runs in an embedded environment. I am trying to see if the first lines until the first script tag is taking those 20 minutes. I know it is unlikely, but I would like to prove it to myself that it is not the cause of the issue. My question is
1) When the browser(IE) sees the first lines until the first script tag, what does it do, does it try and access these sites and download the dtd, http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd and http://www.w3.org/1999/xhtml.

One possibility might be that the user has difficulty accessing these sites and so the browser just waits there.
 
Promod kumar
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear,
Before DOM is constructed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic