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