This is proving to be very interesting and so far, I can't figure it out. I am using the open.window function to open an image in a new window. I have also included in the code a close button and a print button.
If I create an html page, paste this code into it, save and view it, I can get the print function to work. but when I open a new window from a link (ie clicking on the thumbnail) the new window will not print.
Heres the code:
[Code from thumbnail page]
function popupimage() {
newWindow = window.open ("","Map","scrollbars=0,re
sizable=0,
width=760,
height=550
");
newWindow.document.writeln
('<!DOCTYP
E HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"');
newWindow.document.writeln
('"
http://www.w3.org/TR/html4/loose.dtd"
>');
newWindow.document.writeln
('<html><h
ead><title
>Passion Play Map</title></head><body bgcolor="#FFFFFF" text="#000000">');
newWindow.document.writeln
('<img src="../images/passionplay
map3.gif" alt="Location Map"><br>');
newWindow.document.writeln
('<table border=0 cellpadding=10><tr><td align=left valign=top><font size=-1>Location Map</font></td>');
// newWindow.document.writeln
('</font><
br></td>')
;
newWindow.document.writeln
('<td><for
m><input type="Button" NAME="close" VALUE="Close Window" onClick="top.close()"></fo
rm></td>')
;
newWindow.document.writeln
('<td><for
m><input type="Button" NAME="print" VALUE="Print Location Map" onClick="window.print()"><
/form></td
></tr></ta
ble>');
newWindow.document.writeln
('</body><
/html>');
}
The above code is called when I click on the thumbnail as:
JavaScript:popupimage()
Like I said, the window pops up. I am able to close it by clicking on the close button, but It will not print and I can't figure out why. If I make a new blank page with this code and then
http://[the page] I am able to print.
Go figure! Anyone shed some light on this mystery for me?
Start Free Trial