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

PopUp window or not?

Status
Not open for further replies.

GeeWond3r

IS-IT--Management
Joined
Sep 5, 2003
Messages
65
Location
US
How wud i include a javascript routine that tells me whether this current window is a popup window or not?
Reason in doing so is I want to close and open the right windows.
 
Lot's of different ways:

1.You could pass a parameter in the url
var mypopup=window.open('page.asp?popup=true')
Then check for it in the popup using location.search

2.You could give your popup window a name
var mypopup=window.open('page.asp','popupName')
Then check for it using window.name

3.You could assign a value to a variable in the popup
var mypopup=window.open('page.asp','popupName')
mypopup.isPopup=true;

I'm sure there are a lot more ways.

Adam
while(ignorance){perpetuate(violence,fear,hatred);life=life-1};
 
if the window has an "opener", it is a popup.

if (window.opener != null) alert("i am a popup");

=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top