faqts : Computers : Programming : Languages : JavaScript : Windows

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

32 of 1012 people (3%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

Whats the javascript to popup a new window and create a button in the new window? It should give an alert when the button is clicked?

Aug 24th, 2000 15:41
Martin Honnen, Anonymous Account,


var w = open('about:blank', 'windowName',
             'width=100,height=100,resizable=1');
var html = '';
html = '<HTML><BODY><FORM><INPUT TYPE="button" VALUE="button" 
ONCLICK="alert(event.type)"><\/FORM><\/BODY><\/HTML>';
w.document.open();
w.document.write(html);
w.document.close();