Page 1 of 1

Returning to a calling page from popup window

Posted: Sat Dec 06, 2003 11:17 am
by eatrom
I have a client that needs something along this line:

From the main browser page, a link that opens a popup type window, which has links that would target back to the main window. I have the popup window already done and working. My dilema is how to name the calling window so I can target it from the popup window.

Can javascript do an onload to set the window name?? I tired that but got nowhere.

Any help/snippet would be appreciated.

Terry

Posted: Sat Dec 06, 2003 11:23 am
by igoy
let's say you have a link in your popup window, called "go to main Window"... so this is how it works :
<a href="javascript:window.opener.location = 'main.html'">Go to Main Window</a>

Posted: Sat Dec 06, 2003 2:44 pm
by eatrom
That worked, slicker than ****! Thanks!

BTW since I am embedding php in the link as well, it came out looking like:

<a href="javascript:window.opener.location='<? echo("agent_profile.php?agent_id=$AgentID&u=$myID"); ?>'">Agent Profile</a>

Posted: Sun Dec 07, 2003 4:18 am
by igoy
Perfect.... :)

it doesn't matter whatever you user as link.... whatever you are outputting of :

Code: Select all

<a href="javascript:window.opener.location='<? echo("agent_profile.php?agent_id=$AgentID&u=$myID"); ?>'">Agent Profile</a>
will output something like this
<a href="javascript:window.opener.location='agent_profile.php?agent_id=igoy&u=343'">Agent Profile</a>
enjoy!!