brenthel
10-21-2002, 08:45 PM
Basically i trying to retrieve the URL of my parent window after a certain amout of time. Calling cookie_Decider() in the onUnload of the parent page. This code is in the child window. Can this be done? or is there anthor solution to get the same result
function cookie_Decider()
{
setTimeout("check_URL()",5000);
/*one problem is that setTimeout fires right away just displays the results at a later point in time */
}//end function
function check_URL()
{
var run_move=false;
var parent_url = null;
parent_url=new String(window.parent.location);
var parent_url2 = parent_url.substr(7,10);
var server_name = "<?php print $SERVER_NAME; ?>";
var server_name2 = server_name.substr(0,10);
if(server_name2.match(parent_url2)==null)
{
alert("true");
// run_move=true;
}
else
{
window.location.reload();
// run_move=false;
}
if(run_move == true)
{
alert("run=True");
// window.moveTo(300,100);
// window.focus();
}
}//end function
function cookie_Decider()
{
setTimeout("check_URL()",5000);
/*one problem is that setTimeout fires right away just displays the results at a later point in time */
}//end function
function check_URL()
{
var run_move=false;
var parent_url = null;
parent_url=new String(window.parent.location);
var parent_url2 = parent_url.substr(7,10);
var server_name = "<?php print $SERVER_NAME; ?>";
var server_name2 = server_name.substr(0,10);
if(server_name2.match(parent_url2)==null)
{
alert("true");
// run_move=true;
}
else
{
window.location.reload();
// run_move=false;
}
if(run_move == true)
{
alert("run=True");
// window.moveTo(300,100);
// window.focus();
}
}//end function