[an error occurred while processing this directive]
Type a message in the box, it will become a link to close the new window. |
<SCRIPT LANGUAGE="JavaScript">
<!-- Beginning of JavaScript -
function MyWindow(message) {
//Define Date to display in local syntax}
now = new Date();//Define contents of page
LocalTime = now.toLocaleString();
contents=//Create new Window
'<body bgcolor="beige">'+
'<h2>Hello</h2>'+
'Click on the message below to close this window<br>'+
'<A HREF="javascript:window.close()" >'+
message +
'</A>'
newwindow=window.open("","mywindow", options);
options = "toolbar=0,status=0,menubar=0,scrollbars=0," +
"resizable=0,width=300,height=200";
newwindow.document.writeln(LocalTime);
newwindow.document.write(contents);
newwindow.document.close();
// - End of JavaScript - -->
</SCRIPT>
</HEAD>
<BODY bgcolor="white" onLoad="this.form1.text1.focus()">
<TABLE BORDER=1 bgcolor="beige"><tr><td><B>Type a message in the box, <br>it will become a link to close the new window.</B>
<FORM NAME="form1">
<INPUT NAME="text1" TYPE=Text SIZE="50" MAXLENGTH="50"><br>
<INPUT TYPE=Button VALUE="Create my window" onClick="MyWindow(form.text1.value)">
</FORM></TABLE>
</BODY>
</HTML>
Learn Methods |