Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1537 Can I open a popup window with one image in it if one link is clicked, but another image if a different link is clicked?

You are here: irt.org | FAQ | JavaScript | Image | Q1537 [ previous next ]

Try:

<script language="JavaScript"><!--
function openWin(img) {
  winId = window.open('','newwin','width=300,height=400');
  winId.document.write('<body onLoad="if (window.focus) window.focus()"><center>');
  winId.document.write('<img src="' + img + '">');
  winId.document.write('</center></body>');
  winId.document.close();
}
//--></script>

<a href="javascript:;" onClick="openWin('image1.gif'); return false">image1</a>
<a href="javascript:;" onClick="openWin('image2.gif'); return false">image2</a>
<a href="javascript:;" onClick="openWin('image3.gif'); return false">image3

Feedback on 'Q1537 Can I open a popup window with one image in it if one link is clicked, but another image if a different link is clicked?'

©2018 Martin Webb