Solved

simple loading gif before iframe load

Posted on 2009-07-15
1
781 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
[X]
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
1 Comment
 
LVL 35

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

 Watch the Recording: Learning MySQL 5.7

MySQL 5.7 has a lot of new features. If you've dabbled with an older version of MySQL, it is definitely worth learning.

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

626 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