Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Javascript help with window.opener
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 21 June 2001 :  11:57:13  Show Profile  Visit Kat's Homepage
I have been looking into a problem we are having on a client site.

We have a .js file included on a page that contains links to stories.

When someone clicks on a link, a popup window opens displaying that story. The user can then click a link in the popup window that needs to
a) close the popup window and,
b) redirect the main window to the new location as clicked in the popup.

problem is that window.opener will not work because the popup was opened by a link in the .js file and not from the window.

I have tried to use the following code from the .js file to try and set the window.opener to a valid object but this just tries to set it to the .js file instead:


function checkOpener()
if window.opener == null
{
window.opener == self
}

and then to call it:

<a href="newlocation.asp" onClick=checkOpener()></link></a>


I know we can't set the window.opener to 'self' because that just tries to reference the .js file,

BUT I haven't a clue what to set it to to reference the main browser window.

Any suggestions would be welcome.

KatsKorner

tilttek
Junior Member

Canada
333 Posts

Posted - 21 June 2001 :  14:50:01  Show Profile  Visit tilttek's Homepage

function checkOpener(Obj)
if window.opener == null
{
window.opener == Obj
}


and the call:

checkOpener(This)

or

checkOpener(window)



Philippe Gamache
http://www.tilttek.com
http://www.lapageamelkor.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 4.66 seconds. Powered By: Snitz Forums 2000 Version 3.4.07