Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1060 How can I reload the current document in to a 310x422 window with no toolbars?

irt.org | Knowledge Base | JavaScript | Window | Q1060 [ previous next ]

Q1060 How can I reload the current document in to a 310x422 window with no toolbars?

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>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.