By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,466 Members | 1,149 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,466 IT Pros & Developers. It's quick & easy.

before iframe load displaying for 10sec somthing

Fary4u
100+
P: 273
I've got iframe when somebody click on the button it's display on the webpage but it's take about 10 sec to load before that any possibility to display something wd div script or any javascript ( HTML, IMG ) ?
Feb 3 '09 #1
Share this Question
Share on Google+
7 Replies


acoder
Expert Mod 15k+
P: 16,027
Yes, you could have a hidden div or image on the page (display:none or visibility:hidden) which you would show when the button is clicked (style.display = 'block') and hide again when the iframe has loaded.
Feb 3 '09 #2

Dormilich
Expert Mod 5K+
P: 8,639
you could try the network module of FireBug/Firefox to see, what the actual load times are.
Feb 3 '09 #3

Fary4u
100+
P: 273
Yes the same thing i'm doing but i want 10 sec timer or something ?

Expand|Select|Wrap|Line Numbers
  1. <div style="display:none" id="pic">
  2.   <iframe name="wait" src="show_img.asp" border="0" ></iframe>
  3. </div>
  4.  
  5. document.getElementById("pic").style.display='inline';
i want just timer or something else to show like this ?

Display please wait picture before the show_img.asp is not loaded ?
by default it's not executed it's only displaying when somebody click on it.
Feb 3 '09 #4

shweta123
Expert 100+
P: 692
Hi,

Please refer this thread:
http://www.codingforums.com/archive/...p/t-68482.html
Feb 3 '09 #5

acoder
Expert Mod 15k+
P: 16,027
So you want the iframe to show only after it's loaded? Use the iframe onload event handler to show the iframe when ready.
Feb 3 '09 #6

Fary4u
100+
P: 273
@acoder
yes i've used this but it's came up very quickly
i've trying to use onafterupdate but it's don't work &
i've not came cross some gud example : (
Feb 23 '09 #7

acoder
Expert Mod 15k+
P: 16,027
If it loads quickly, then there's no need to display a wait/loading message. If it does take 10 seconds or so, the onload will be fired when the iframe has loaded at which point you can hide the div/image.

If you insist on showing it for 10 seconds, you can use setTimeout(), but it would be unreliable because the iframe may take longer to load or it might load in only 2-3 seconds.
Feb 23 '09 #8

Post your reply

Sign in to post your reply or Sign up for a free account.