Code:
var newwindow
function popimage(url , title , note) {
if (newwindow && !newwindow.closed)
{ newwindow.focus(); newwindow.document.clear() }
else
{ newwindow=window.open('','','width=875,height=575,top=50,left=50') }
newwindow.document.writeln('<html>');
newwindow.document.writeln('<head>');
newwindow.document.writeln('<script language="JavaScript" src="vars.js" type="text\/javascript"><\/script>');
newwindow.document.writeln('<title>' + title + ' Image<\/title>');
newwindow.document.writeln('<style type="text\/css" media="screen">@import url("style_2008.css")\;<\/style>');
newwindow.document.writeln('<\/head>');
newwindow.document.writeln('<body>');
newwindow.document.writeln('<div style="margin-top: 5px"><center><img src="' + url + '" alt="Image">');
if (note)
newwindow.document.writeln('<br>' + note + '<br>');
newwindow.document.writeln('<form>');
newwindow.document.writeln('<input type="button" value="Close Window" onClick="window.close()">');
newwindow.document.writeln('</form><\/center>');
newwindow.document.writeln('<\/div>');
newwindow.document.writeln('<\/body>');
newwindow.document.writeln('<\/html>');
newwindow.document.close();
}
And when you pass the variable to the call, it shouldn't be quoted, you also should not use javascript:whatever in the href (messes up sometimes in some browsers):
Code:
<a href="/images/chainlink_lrg.jpg" onclick="popimage(this.href,'Boat Photo', txt);return false;">Enlarge</a>
Alternatively, you could pass a literal text string, then it should be quoted:
Code:
<a href="/images/chainlink_lrg.jpg" onclick="popimage(this.href,'Boat Photo', 'This is a sample Note');return false;">Enlarge</a>
Bookmarks