Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

window.opener.focus() not working in FireFox

Status
Not open for further replies.

FesterSXS

Programmer
Feb 4, 2002
2,196
GB
Hi,

I have a parent window that opens a child window. The child window has a button to return focus to the parent.

Works fine in IE but no response in FireFox.

Here is the code that opens the child:
Code:
<a href="resources.asp" target="ResourceWindow">Saturated Steam Table</a>

and here is the code for the button to return focus to the parent:
Code:
<input type="button" value="Return to Test" onclick="window.opener.focus();" />

Any suggestions for getting this working in FF also?

Tony
---------------------------------------
 
[1] opener takes on a functional sense when the child window is opened through the operation window.open(). This is how it can be done.
[tt]
<a href="#" onclick="window.open('resources.asp','ResourceWindow','width=250px,height=250px,left=350px;');return false;"></a>
[/tt]
Arbitray features are there for illustration and to get a chance to see what happens to the opener as well.

[2] There are these specific behaviours with (href="#") and (return false;) combined:
[2.1] the opener lost focus to the child window when "ResourceWindow" does not exist (ie, clicked the first time)- this is a desirable behaviour;
[2.2] the opener retains its focus when the child window "ResourceWindow" exists (ie, previously clicked);
[2.3] the opener page will _not_ be scrolled, in particular, not be scrolled up to the top

[3] Ther requested behaviour triggered from the child window take effect cross-browser.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top