Forum Moderators: open

Message Too Old, No Replies

controlling the parent window from a pop up

         

cambrewer

1:35 pm on Aug 24, 2004 (gmt 0)



Hello!

Ok, I'm not sure if this is possible, I am pretty new to javascript, so thought I would ask some pro's!

I have a pop-up window that will be a site map, now, when someone presses something in the pop-up, I would like the parent window to go to that page...

Is that possible? And if so, can anyone give me some hints to the code...?

Thanks in advance for any help...

Cam

Birdman

3:01 pm on Aug 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I believe it goes like this:

window.opener.location.href = new_url;

You can wrap it up in a function for easy usage, like this:

function go(url){
window.opener.location.href = url;
}

<a href="javascript: go('/new_url.html')">

By the way, welcome to the forum!

Birdman

Majinboo

12:11 am on Sep 28, 2004 (gmt 0)

10+ Year Member



Hey,

I have the same problems here: New to JS (so, even if there's an answer here, I'm really not sure how to implement it) and want to control a parent window from popup. :P

What do I have: - 1 main window which links to a search form (powered by Atomz) opening in a popup which also encloses the search result.

What do I want: - To click on search results and the target page open on the parent window so we keep the popup with the results.

My popup code right now is like that:

function popUp()
{
window.open('search.php','search','toolbar=no,location=no,[br]directories=no,status=no,menubar=no,resizable=yes,[br]copyhistory=no,scrollbars=yes,width=500,height=400');[br]}

and Birdman said:

window.opener.location.href = new_url;

(...)
<a href="javascript: go('/new_url.html')">

The

<a href="javascript: go('/new_url.html')">
part should go on the main page, or parent, calling the popup right?

Can I fit those parameters like:

window.opener.location.href = ('search.php','search','toolbar=no,[br]etc, etc etc);
?

Also: Atomz uses proprietary tags to parse the result pages like:

<SEARCH-LINK>
while
TARGET=_blank/_self/_top/_parent/_frameName
is the allowed parameter to define where to load.

I hope it's clear enough.

Thanks

P.S. - btw, anyone could refer to a basic JS forum?

Majinboo

2:52 am on Sep 29, 2004 (gmt 0)

10+ Year Member



Nobody willing to give a little help? Please?

Thanks