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

Proper coding of Pop-up window

Status
Not open for further replies.

Ineedjava

Technical User
Apr 14, 2001
21
US
The code below from the Bestbuy website is somewhat confusing to me.

In pseudo code it is saying "if newWindow exists and newWindow is not closed, then focus on newWindow, then assign a url to newWindow"

Well, if newWindow exists then why test to see if it is closed?

---- Code -------------

function popUp(url,name) {
if (newWindow) {
if (newWindow.closed == false) {
newWindow.focus();
}
}
newWindow = window.open(url,name,'toolbar=0,width=580,height=480');
}
 
I think all that means is that if the newWindow is not closed then it will focus, if the newWindow is closed then it will not asign the URL...this is like a throw-and-catch type, so the asigned URL isn't lost and cause some error...
Does that make sense?? I don't know if I explained it right... I have not failed; I merely found 100,000 different ways of not succeding...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top