Hi,
I current have a page with frames, the top frame is timer that counts down 10 seconds. The bottom page is a site. Once the top frame is done counting down from 10 seconds I want to see if the bottom page has changed (if the user has clicked). The bottom page is NOT part of my website.
Here is the code for the frameset.
Here is the top frame. (showTimer2.php)
There is some PHP in here. As you can see what I tried to do. In the frameset I load the site URL into a javascript variable. Then in the top frame once the 10 seconds has counted I try to check and see if the URL has changed.
The only problem is I get a permission denied when executing "parent.contentPage.location.href" because it's not my domain. Do you have any ideas?
I current have a page with frames, the top frame is timer that counts down 10 seconds. The bottom page is a site. Once the top frame is done counting down from 10 seconds I want to see if the bottom page has changed (if the user has clicked). The bottom page is NOT part of my website.
Here is the code for the frameset.
Code:
<head>
<title></title>
<script language="javascript">
var startURL = "<?=$r['siteURL']?>";
function reLoad()
{
window.opener.location.reload();
}
function getNew()
{
if(window.location.href!=startURL)
{
return parent.contentPage.location.href;
}
else
{
return 0;
}
}
</script>
</head>
<frameset rows="80,*">
<frame name="banner" scrolling="no" noresize src="showTimer2.php?s=<?=$s?>&aid=<?=$aid?>">
<frame name="contentPage" scrolling="yes" noresize src="<?=$r['siteURL']?>">
</frameset>
</html>
Here is the top frame. (showTimer2.php)
Code:
<html>
<head>
<title></title>
<link href="<?=$config['siteDir_url']?>style/style.css" rel="stylesheet" type="text/css">
<script>
function doLoad()
{
setTimeout( "refresh()", <?=$special?>*1000 );
}
function refresh()
{
alert(parent.getNew());
}
</script>
</head>
<body bgcolor="#000066" class="body" onload="doLoad()"'?>>
<table width="750" cellpadding="0" cellspacing="0" border="0" class="ptc">
<tr>
<td width="175" valign="top"><img src="<?=$config['siteDir_url']?>images/smallLogoNo.gif"></td>
<td><?=$message?></td>
</tr>
</table>
</body>
</html>
There is some PHP in here. As you can see what I tried to do. In the frameset I load the site URL into a javascript variable. Then in the top frame once the 10 seconds has counted I try to check and see if the URL has changed.
The only problem is I get a permission denied when executing "parent.contentPage.location.href" because it's not my domain. Do you have any ideas?