You are here: irt.org | FAQ | JavaScript | Window | Q1060 [ previous next ]
You'll have to open another window, and then close the current window to achieve what you want.
<SCRIPT LANGUAGE="JavaScript"><!-- if (history.length != 1) { window.open(location.href,'main','width=310,height=422'; setTimeout('self.close()',1000); // close self after a seconds delay } //--></SCRIPT>
It is possible to resize the current window in both Internet Explorer 4 and Netscape Navigator 4 with:
<SCRIPT LANGUAGE="JavaScript"><!-- if (window.screen) { window.resizeTo(310,422) } //--></SCRIPT>
It is possible in Netscape Navigator 4 to remove the toolbars and stuff (but I think this is a bug - and therefore shouldn't be relied upon):
<SCRIPT LANGUAGE="JavaScript"><!-- window.open('','_top','menubar=0,location=0,toolbar=0,personalbar=0,status=1,scrollbars=1'); //--></SCRIPT>
In Netscape Navigator 4 you can also remove the toolbars - legitimately - after requesting extra privileges:
<SCRIPT LANGUAGE="JavaScript1.2"><!-- if (document.layers) { netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserWrite'); window.toolbar.visible = false; window.statusbar.visible = false; window.scrollbars.visible = false; window.personalbar.visible = false; window.menubar.visible = false; window.locationbar.visible = false; } //--></SCRIPT>