Click to See Complete Forum and Search --> : Targeting links to Specific Windows


Nulrick
08-26-2003, 12:33 PM
Hi!

In a website I'm working on, a little pop-up window launches along with the main browser winidow. This pop-up gives a menu of options to choose from. When an option is chosen, it should load in the main browser window.

How can I direct the link in the pop-up to the main browser window?

Charles
08-26-2003, 12:41 PM
<a href="http://www.w3.org/" onclick="if (top.opener && !top.opener.closed) {top.opener.location = this.href; return false">W3C</a>

Nulrick
08-26-2003, 01:23 PM
are you familiar with flash? I'm making this site in flash and the actionscript command for creating a link is "Get URL". I'm wondering how to incorporate your code into the actionscript

fshea31
08-26-2003, 01:51 PM
Set up the javascript function in your html head tag and give it a name:

<script type="text/javascript">
function myMenu {
if (top.opener && !top.opener.closed) {
top.opener.location = this.href; return false;
}
}
</script>

Then your actionscript link would be getURL ("javascript:myMenu").