View Full Version : JS: Close popup window and then send parent page to URL
I have a embedded flash object. ONce you done, it captures data and closes the window. I want the popup window to send a URL to the parent page.
does that make sense? Upon close of popup, send parent to certain URL.
Horus_Kol
09-04-2008, 07:17 PM
<head>
...
<script type="text/javascript">
function redirect_parent()
{
parent.location = "http://www.example.com";
}
</script>
</head>
<body onunload="redirect_parent()">
...
quick example - you could replace the string with whatever variable is set by the flash object
Im not sure what you mean?
Is this what you are saying:
<!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>Cortex with Insight: Jewel Diver Testlet</title>
<script type="text/javascript">
function redirect_parent()
{
parent.location = "http://www.yahoo.com";
}
</script>
</head>
<body onunload="redirect_parent()">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="800" height="600">
<param name="movie" value="/sitecustomer/JD/jeweldiver.swf" />
<param name="quality" value="high" />
<param name="FlashVars" value="sendUrl=http://www.site.com/allstatecustomer/JD/JDpostForward.php?">
<embed src="/sitecustomer/JD/jeweldiver.swf" FlashVars="sendUrl=http://www.site.com/sitecustomer/JD/JDpostForward.php?" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="800" height="600"></embed>
</object>
</body>
</html>
rangana
09-06-2008, 12:30 AM
Have a try on:
function redirect_parent(){window.opener.location.href='http://www.google.com';}
yep, thats the trick.
Thanks!
rangana
09-06-2008, 10:46 PM
No problem, we're glad to help :)
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.