You are here: irt.org | FAQ | JavaScript | Window | Q1233 [ previous next ]
If you define your own open() function:
<script language="JavaScript"><!-- function open() { } //--></script>
After you've stopped the popup window you'll not be able to open your own so try the following code which works in Netscape Navigator 3+ and Internet Explorer 4+:
<html> <head> <script language="JavaScript"><!-- var saveOpen = window.open; window.open = myOpen; if (window.focus) window.focus(); function myOpen() { alert('No way'); return null; } function restoreOpen() { window.open = saveOpen; } //--></script> <head> <body onLoad="window.open('redefine.htm','newwin')"> <a href="javascript:;" onClick="restoreOpen(); return false">restore</a> <br> <a href="javascript:;" onClick="window.open('redefine.htm','newwin'); return false">open</a> </body> </html>
Using this code on GeoCitites, XOOM or any other similar site might get you thrown out.