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

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

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

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

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>

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.