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

Q802 Is it possible to open a window, add data to it periodically and keep it hidden until I need it?

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

Yes:

<SCRIPT LANGUAGE="JavaScript"><!--

function update(i) {
    now = new Date();
    myWindow.document.write(i + ' = ' + now + '<BR>');
}

myWindow = window.open("about:blank","","height=200,width=400")
self.focus();
myWindow.document.open();

for (var i=1; i<10+1; i++) {
    setTimeout('update(' + i + ')',i*1000); // update the window every second for 10 seconds
}

setTimeout('myWindow.focus()',12000); // show window after 12 seconds

//--></SCRIPT>

©2018 Martin Webb