Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

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

You are here: irt.org | FAQ | JavaScript | Window | Q141 [ previous next ]

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>

©2018 Martin Webb