Window control

C

coder

Say you have a window that spawns a second window (through window.open() ).
Is it possible to have a button click in the child window produce a change
in the parent window?
 
M

mbstevens

coder said:
Say you have a window that spawns a second window (through window.open() ).

Yes, but it is seldom a good idea.
Is it possible to have a button click in the child window produce a change
in the parent window?

Investigate the openRemote() function. Remote control windows are
(unfortunately) quite common on the net.
 
S

Shelly

mbstevens said:
Yes, but it is seldom a good idea.

Here is my situation. I have an app running. There is also a pop-up window
with a list of places to call to followup sales leads. Each company on that
list is now a hyperlink that opens up the company information in that same
child window. To go to the next one, the user would have to use the back
button on the browser. I would like to have the company information appear
in the parent window when the company name is clicked in the child window
(it doesn't have to be a hyperlink). This would make for the cleanest app.
So, why is it "seldom a good idea"?
Investigate the openRemote() function. Remote control windows are
(unfortunately) quite common on the net.

Why "unfortunately"? I'll look into openRemote().
 
M

mbstevens

mbstevens said:
Investigate the openRemote() function. Remote control windows are
(unfortunately) quite common on the net.
This is not a built-in function.
Details...
.....
var remote = null;
window.name = "content";
function
openRemote(contentURL, windowName,x,y){
wh='height=' + y + 'width=' + x;
remote=window.open(zotURL,windowName,wh);
remote.focus();
}
.....
<<This was adapted from Teague's DHTML book.>>

The control window can use calls like:
....
<a href= "x.html" target="content"> xstuff </a>
....

openRemote is called with stuff like:
....
<a href="javascript::eek:penRemote('remote.html','remote', 200,500)">Open Controls</a>
....
 
M

mbstevens

Shelly said:
Here is my situation. I have an app running. There is also a pop-up window
with a list of places to call to followup sales leads. Each company on that
list is now a hyperlink that opens up the company information in that same
child window. To go to the next one, the user would have to use the back
button on the browser.

No, you just use either a preprocessor or server side programming
to reproduce the navigation list on each page.
I would like to have the company information appear
in the parent window when the company name is clicked in the child window
(it doesn't have to be a hyperlink). This would make for the cleanest app.
So, why is it "seldom a good idea"?


They can confuse search engines, and they are a pain for the visitor.
The little window has to come up with focus, so your visitor usually has to
reposition it. There is the matter of when to close it. If your
visitor has a pop up blocker, s/he will have to click to get the pop up.

It will be easier to just have everything your visitor needs right
in the window with the content.
 
S

Shelly

mbstevens said:
Yes, but it is seldom a good idea.


Investigate the openRemote() function. Remote control windows are
(unfortunately) quite common on the net.

When I changed the link to:
<a href="javascript:go('client.php?type=edit&id=16')" TestClient Five</a>

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

in the script section, it worked like a cherm. Thank you very much.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top