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

Q141 How can I open a new window by passing the width and height as parameters from a function?

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

Q141 How can I open a new window by passing the width and height as parameters from a function?

Try:

<SCRIPT LANGUAGE="JavaScript"><!--
function windowOpen(width,height) {
    myWindow = window.open("","windowRef","width=" + width + ",height=" + height+",top=0,left=0,screenX=0,screenY=0");
    myWindow.location.href = "apage.html";
    if (!myWindow.opener) myWindow.opener = self;
}

function myVoid() {;}
//--></SCRIPT>

<A HREF="javascript:myVoid()" onClick="windowOpen('size.htm',800,600);return false">800x600</A>

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.