Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

simple loading gif before iframe load

Posted on 2009-07-15
1
773 Views
Last Modified: 2012-06-27
i have a page with iframe included to load the page. some time the iframe page takes time to load. How do I place loading gif till the page loads it completely. it is html page.

Is there simple div or javascript code to do that? i don't prefer ajax.
0
Comment
Question by:Loganathan Natarajan
1 Comment
 
LVL 34

Accepted Solution

by:
gr8gonzo earned 125 total points
ID: 24862380
In the parent document, create a div that contains your loading message / icon, like this:

<div id="divLoading">Loading...</div>
.....
<iframe src="/your/iframe.php"></iframe>

Then, in your iframe.php file, add some Javascript that looks like:

<script type="text/javascript">
function hideLoadingDiv() {
parent.getElementById("divLoading").style.display = "none";
}
window.onload = hideLoadingDiv;
</script>
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jQuery force form POST 7 48
Javascript 2 24
How can I make the first part identical to the second ? 1 26
Why is initMap returning "not a function" error. 3 30
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question