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

Q989 Is it possible to make a popup screen with your own title (caption)?

You are here: irt.org | FAQ | JavaScript | Document | Q989 [ previous next ]

Try:

<script language="JavaScript"><!--
var windowHandle = '';

function openWindow() {
    windowHandle = window.open('about:blank','windowName','width=400,height=400');
    // alternatively use: window.open('blank.htm',...)
    setTimeout('updateWindow()',2000);
}

function updateWindow() {
    windowHandle.document.open();
    windowHandle.document.write('<HTML><HEAD><TITLE>Hello World<\/TITLE><\/HEAD><BODY><H1>Hello World<\/H1><\/BODY><\/HTML>');
    windowHandle.document.close();
}
//--></script>

<form>
<input type="button" onClick="openWindow()" value="Open Window">
</form>

©2018 Martin Webb