Partial load of website > Iframe

Discussion in 'General Programming Chat' started by 19w08, Apr 2, 2009.

  1. 19w08

    19w08 Guest

    Hi Guys,

    When loading a website trough a iframe it causes the statusbar going into overdrive in FF.

    Is there a script that loads the targeted website for an specific amount of time, just to make ' the hit' instead of loading the whole thing?

    Thanks in advance guys
  2. drdankmendez

    drdankmendez Regular Member

    May 30, 2008
    Likes Received:
    In front of my computer
    You can use javascript to do this. Here is an example page, in the example an iframe is loaded with, after 5 seconds the iframe is removed from the page.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <html xmlns="">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Example Iframe Remover</title>
    	<script type="text/javascript">
    		function clearDiv(divId){
    			document.getElementById(divId).innerHTML = '';
    		setTimeout("clearDiv('iFrameHolder')", 5000);	
    	<div id="iFrameHolder">
    		<iframe src=""></iframe>
    What is happening here is when the page loads it is loading a DIV tag with an ID of "iFrameHolder", inside this DIV is the iframe calling google. On page load the javascript waits 5 seconds (setTimeout - 5000) then sets the innerHTML (contents) of the DIV to '' (nothing).

    Hope this helps.
  3. 19w08

    19w08 Guest

    Hi drdankmendez,

    Dude you nailed it exactly on he spot. I was looking to other options but they all failed.
    Didnt know actually that there was a option like this.

    It works like a charm, and u made my day.

    Rep given, you are a asset to this community.