Use One Window To View Multiple Thumbnails

Use the same window to view multiple images

The Problem:
I have a table with thumbnails.  When clicked, I have a new window open using, target="_blank".  Well and good.  Now, is there a way to re-use that newly opened window for the next image when a thumbnail is clicked?  Presently you must close that new browser window or another window opens.  Before long you've got many browser windows open and eventually must close them all.

The Solution:
JScript to the rescue

<script language="JavaScript">
<!--
var MyWin=0;
function oWin(url){
if(!MyWin||MyWin.closed) MyWin=window.open(url);
else MyWin.location.href=url;
}
//-->
</script>


Call it like this
<a href="JavaScript:oWin('Page.htm')">Link</a>



javascript window.open reuse open windows


Back To Top
© 1998 - 2024 psacake.com
Version 7.21 | Advertise on this site