Partial load of website > Iframe

1

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
 
You can use javascript to do this. Here is an example page, in the example an iframe is loaded with google.com, after 5 seconds the iframe is removed from the page.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Example Iframe Remover</title>
</head>

<body>
	<script type="text/javascript">
		function clearDiv(divId){
			document.getElementById(divId).innerHTML = '';
		}
		setTimeout("clearDiv('iFrameHolder')", 5000);	
	</script>	
	<div id="iFrameHolder">
		<iframe src="http://www.google.com"></iframe>
	</div>
</body>
</html>

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.
 
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.


TC
 
Back
Top