Returning to a calling page from popup window

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
eatrom
Forum Newbie
Posts: 15
Joined: Tue Jul 16, 2002 8:32 am
Location: White North of Minnesota

Returning to a calling page from popup window

Post 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
User avatar
igoy
Forum Contributor
Posts: 203
Joined: Fri May 02, 2003 11:57 pm
Location: India
Contact:

Post 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>
eatrom
Forum Newbie
Posts: 15
Joined: Tue Jul 16, 2002 8:32 am
Location: White North of Minnesota

Post 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>
User avatar
igoy
Forum Contributor
Posts: 203
Joined: Fri May 02, 2003 11:57 pm
Location: India
Contact:

Post 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!!
Post Reply