Hi all, I am doing a tutorial that creates a window but how do I make a link to go in the new window so that it can be closed by clicking Close.
I would also like to know what the line “myWin.document.close();” actually does.
thx
Code:
<html>
<head>
<script language="JavaScript">
<!-- hide script from browser
function openWin3()
{
myWin=open("", "displayWindow", "width=500,hight=400,status=yes,toolbar=no,menubar=no");
//open document for further output
myWin.document.open();
//create document
myWin.document.write("<html><head><title>on-the-fly");
myWin.document.write("</title></head><body>");
myWin.document.write("<center><font size=3>");
myWin.document.write("Document has been created on the fly");
myWin.document.write("</font></center>");
myWin.document.write("</font></center>");
myWin.document.write("</body></html>");
//Close the document (not the window!)
//myWin.document.close();
}
//-->
</script>
</head>
<body>
<form>
<input type=button value="On-the-fly" onClick="openWin3()">
</form>
</body>
</html>
I would also like to know what the line “myWin.document.close();” actually does.
thx