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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Firefox tab window.opener

Status
Not open for further replies.

rac2

Programmer
Apr 26, 2001
1,871
US
Is there a way to do this when the page is in a tab instead of a new window?
Code:
window.opener.location = "main.asp";

I have a main page which lists work to do. The agent clicks a link on one of the items. This opens a new window, a form related to the item. Upon submitting the form, I wish to refresh the main page because the item has been handled and we need a new list. The Javascript above is on the page in the new window.

All of that works until we started using Firefox with tabbed browsing. Some agents like to open the form in a tab instead of a pop-up window. This can be done by middle-clicking the link, or by right-clicking and selecting Open Link in New Tab. When we do that, window.opener is not an object, the Javascript dies, the main page is not refreshed, and other things which happen after that line of code are not executed.

Is there a way to refer to the tabbed page, my main page, which opened the page in the new tab?
 
Im not interested in controlling the use of tabs. I am interested in accomodating this.

Does a tab have a representation in the DOM? Can Javascript in one tab refer in any way to objects in another tab?

 
If enabled in FF I would guess that window.opener (et al) would be the way ...
 
Woops!! Sorry - didn't see you tried that already. Sorry, man ;-)
 
The tab does not have a representation in the DOM. It's just another page that the browser is displaying - nd the user has chosen to have it display as a tab. You've got no control over it... and cannot close it etc.

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top