I have a page with several pop-up menus, each containing links to other sites. I call a function popLink() from the onChange handler in the <select> form element. This is the guts of popLink():
I use eval() because I want each window to have it's own name that I can reference to focus() it when the user chooses that same option from one of the pop-up menus. The problem is what happens if the user has closed one of the spawned windows and then reselects an option from the pop-up. The first test passes but the new object is a String not a window. How do I see if a window exists but still using eval()? Simply doing the followingCode:if (eval ("typeof(" + name + "Win) != 'undefined'")) { eval (name + "Win" + ".focus()"); } else { eval (name + "Win" + " = window.open(url,name,win_attr)"); }
always returns true presumably because it's testing whether it can evaluate the expression.Code:if (eval (name + "Win"))
I know there is a way to do this but I guess I am too retarded to figure it out. Any help would be greatly appreciated.





Bookmarks