I'm trying to solve a trivial problem of opening a new window over the original window where the link to the window was clicked. At the moment, the new window opens but I loose the original window.
I need the original window to be visible (stay open) at the same time as the new (smaller) window. The code for the original link page and the new window are shown below.
Here's the initial page where the link is located.
and here's the code for the new window page.
Thanks
I need the original window to be visible (stay open) at the same time as the new (smaller) window. The code for the original link page and the new window are shown below.
Here's the initial page where the link is located.
Code:
<html>
<head>
<title>Click here to show the popup window over this text in the original window</title>
</head>
<body>
<p>Click
<a href="test_popup_6.html">
here</a> to show the popup window over this text in the original window, with both visible at the same time.</p>
</body>
</html>
and here's the code for the new window page.
Code:
<html>
<head>
<title>New Page 1</title>
</head>
<body>
<script language="JavaScript" type="text/JavaScript">
popwidth=400;
popheight=450;
leftpos1=420;
toppos=210;
popbackground="orange";
textdescription="TEXT HERE";
var winattributes='width='+popwidth+',height='+popheight+',resizable=no,left='+leftpos1+',top='+toppos
var bodyattribute=(popbackground.indexOf(".")!=-1)? 'background="'+popbackground+'"' : 'bgcolor="'+popbackground+'"'
if (typeof jkpopwin=="undefined" || jkpopwin.closed)
jkpopwin=window.open("","",winattributes)
else{
//getpos() //uncomment these 2 lines if you wish subsequent popups to be centered too
//jkpopwin.moveTo(leftpos, toppos)
jkpopwin.resizeTo(popwidth, popheight+30)
}
jkpopwin.document.open()
jkpopwin.document.write("<html><title>test</title><head>\n"+ "<script language='Javascript'>\n function cls()\n\{self\.close()\}\n"+ "<\/script><head>\n<body "+bodyattribute+"><center>\n<br><br>"+textdescription+"<BR><BR>"+ "<BUTTON onClick='cls()'>Close Window</BUTTON></center></body></html>");
//jkpopwin.document.write('<html><title>test</title><head>\n"</head> <body '+bodyattribute+' ><center><br><br>'+textdescription+'<BR><BR><BUTTON onClick="cls()">Close Window</BUTTON></center></body></html>')
jkpopwin.document.close()
jkpopwin.focus()
</script>
</body>
</html>
Thanks