...

View Full Version : Close Window Link Only Visible in Popup



bill_dubay
03-10-2005, 11:35 PM
Please help! Does anyone know how to create a text link "Close Window" that will appear on a popup window. The trick is, I need it to appear only if the window is a popup window not if it is the parent window. Please help! Thanks.

Bill

glenngv
03-11-2005, 05:34 AM
<script type="text/javascript">
if (opener) document.write('<a href="#" onclick="window.close()">Close Window</a>');
</script>

bill_dubay
03-11-2005, 03:35 PM
Thanks Glenn, this works great!!!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum