Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
|
This can only be achieved if the iframe have it's url on the same domain that your main page.
IE: the main page url is http://www.whatever.com/index.html
If the iframe points to something else than http://www.whatever.com/..., you will not be able to detect the loading.
Then, for the fun part, in your main page:
HTML Code:
<script type="text/javascript">
function iframeLoaded(){
alert('the iframe is loaded');
}
</script>
<iframe id="ifSub" name="ifSub" src="http://www.whatever/iframe.html" onload="javascript:iframeLoaded();"></iframe>
Just 1 note: every time the iframe will load a page, the event onload will trigger, meaning that it won't be only on the initial load.
If you want to avoid that, use a counter value to restrict the effect to the first call.
__________________
Only a biker knows why a dog sticks his head out the window.
|