Log in

View Full Version : Iframes with url



jatinder.bimra
08-13-2009, 05:29 AM
Hi,
I have a problem with iframes,

I want to include page from different url in iframe,

i did it so far but it redirect idirectly to main url, how can i stop in iframe only....

my code is



<!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=utf-8" />
<title>KI Windows Films - Car Tinter</title>
</head>
<body onload=top.location.replace(location.href)>
<center>
<div>
<iframe src="http://www.johnsonwindowfilms.com/car_tinter/tinter.php" id="i" name="i" width="700px" height="500px" align="middle"></iframe>
</div>
</center>
</body>
</html>

:)

Beverleyh
08-13-2009, 02:03 PM
If you view the source code of their page you'll see that they have this break-out-of-frames script:


<script language="JavaScript" type="text/javascript">
<!--
function breakout_of_frame()
{
// see http://www.thesitewizard.com/archive/framebreak.shtml
// for an explanation of this script and how to use it on your
// own website
if (top.location != location) {
top.location.href = document.location.href ;
}
}
-->
</script>

Which means it stops that page from being contained in another website's Iframe, like yours - Sorry!