ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  Handling Windows and Frames Across Browsers
Subject:   pop-up buster
Date:   2001-08-30 00:51:32
From:   slevy1
I have a site that is enclosed in frames. Someone tried to link to my site by having it load into a new window when the link was clicked. So, I decided to see what I could do to prevent my site from being a popup. Here's what I did:

<script language="Javascript">
// works with ie5.5 on a PC with Windows 95
// but doesn't work with Netscape 4

// works even if opener is undefined

if (top.opener){
top.opener.location.href = "http://www.preservestaffnow.org";