Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to time page download in an iframe

Status
Not open for further replies.

riffraff76

Technical User
Jul 2, 2008
7
GB
Hi all,

I've created a page with 3 iframes.
Above them in the parent are 3 input boxes and one button allowing the user to enter 3 different urls, hit the button and each url is loaded in the iframes.

My question is this, is it possible to time how long it takes each iframe to load its page and also display this to the user?
I'm not very good at javascript but i was thinking of including some logic where a variable is set to the current time on clicking the button.
Then either having the onload event for each iframe register with the parent in some way OR have the parent poll a variable that gets set in the iframe when the onload occurs, then just subtracting the time when this occurs with the original time variable.

Is it possible?

Also, is there anyway in javascript to find the size in bytes of a particular web page with all its images etc?

Thanks in advance!
 
You should be able to achieve this using a global javascript variable. You can set the variable initially when the user clicks the load button (using the [tt]onclick[/tt] event of the button), and then compare it to the current time using the [tt]onload[/tt] event of the iframe.

----
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top