Do you not where window.open() opens your new windows? Using this JavaScript, you can actually have the new window open wherever you want! Look at our example to see what we mean! Really neat!
- Paste the first code in the HEAD of your HTML document
- Add the last coding to the BODY of your HTML document
<!– STEP ONE: Paste the first code in the HEAD of your HTML document –>
<HEAD>
<SCRIPT LANGUAGE=”JavaScript”>
<!– This script and many more are available free online at –>
<!– The JavaScript Source!! http://javascriptsource.com –>
<!– Begin
function win() {
msg=window.open(“”,”msg”,”height=200,width=200,left=80,top=80″);
msg.document.write(“<html><title>Windows!</title>”);
msg.document.write(“<body bgcolor=’white’ onblur=window.close()>”);
msg.document.write(“<center>page content here</center>”);
msg.document.write(“</body></html><p>”);
// If you just want to open an existing HTML page in the
// new window, you can replace win()’s coding above with:
// window.open(“page.html”,””,”height=200,width=200,left=80,top=80″);
}
// End –>
</script>
<!– STEP TWO: Add the last coding to the BODY of your HTML document –>
<BODY>
<body bgcolor=”white”>
<center>
<form>
<input type=”button” value=”Open Window” onclick=”win()”>
</form>
</center>
<!– Or you may use: <a href=”javascript:win()”>Open Window</a> –>
<p><center>
<font face=”arial, helvetica” size=”-2″>Free JavaScripts provided<br>
by <a href=”https://javascriptsource.com”>The JavaScript Source</a></font>
</center><p>