<HTML><HEAD><TITLE>Popup Window Demo</TITLE>
<SCRIPT LANGUAGE="JavaScript1.2" src="popup.js">
</SCRIPT>
</HEAD>
<BODY onUnload="closeDep()">
<H3>Popup Window Demo</H3>
<center>Click <a href="javascript:popup(demo)">here</a>
to see a popup window. </center>
</BODY>
</HTML>
/*******Popup Window Definition*********************/
var htmlOpener = "<html><head><title>Popup Window Demo</title>"+
"</head><body bgcolor='navyblue'><p>"
var htmlCloser = "</body></html>"
demo = "<center><b>Popup Window</b></center><p>Here you can put any legal"+
" html string. For example, you can put a graph here. <center>"+
" <p><img src="corr.gif"></center>"
/****END OF STRING DEFINITION*****/
var popupWin
var wholeWin
function popup(term) // write corresponding content to the popup window
{
popupWin = window.open("", "puWin", "width=480,height=200,scrollbars,dependent,resizable");
popupWin.document.open("text/html", "replace");
popupWin.document.write(htmlOpener);
popupWin.document.write(term);
popupWin.document.write(htmlCloser);
popupWin.document.close(); // close layout stream
popupWin.focus(); // bring the popup window to the front
}
function closeDep() {
if (popupWin && popupWin.open && !popupWin.closed) popupWin.close();
if (wholeWin && wholeWin.open && !wholeWin.closed) wholeWin.close();
}
Copy the html code to a html file and copy the Javascript code to a file called popup.js and save them in a directory, off you have a popup window webpage! You can now modify the code to have your own popup windows.