Hi, I'm new here. My goal is to use javascript so that when a small thumbnail image is clicked on, the larger version of the image is displayed in a separate pop-up window.
Gee, it seems simple enough. When I use the code for this task (borrowed from the free website below) and run it from my local hard drive, then the small thumbnail image will be displayed but the large image will not be displayed in the pop up window. (In the popup window I get the "Cannot find server. ...The page cannot be displayed" error in IE 5.0) Very frustrating, and I have the jpeg images labeled correctly and stored in the same directory as the web page.
Well, here is the link to the original javascript code:
And below is the code as modified for use with locally stored files named small.jpg (thumbnail image), and large.jpg (large image).
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Popup Window Image Preview</title>
<script language="javascript">
<!-- hide from old browsers
function selectWin(source,h1,w1){
newWin = window.open(source,'','height=' + h1 + ',width=' + w1 + ',top=10,left=0');
}
// stop hiding -->
</script>
</head>
<body>
<p><a href="javascript:selectWin('_blank.htm?image=large.jpg&height=276&width=500',276,500)"><img border="2" src="small.jpg" alt="large.jpg (24095 bytes)" width="100" height="55"></a></p>
</body>
</html>
Gee, it seems simple enough. When I use the code for this task (borrowed from the free website below) and run it from my local hard drive, then the small thumbnail image will be displayed but the large image will not be displayed in the pop up window. (In the popup window I get the "Cannot find server. ...The page cannot be displayed" error in IE 5.0) Very frustrating, and I have the jpeg images labeled correctly and stored in the same directory as the web page.
Well, here is the link to the original javascript code:
And below is the code as modified for use with locally stored files named small.jpg (thumbnail image), and large.jpg (large image).
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Popup Window Image Preview</title>
<script language="javascript">
<!-- hide from old browsers
function selectWin(source,h1,w1){
newWin = window.open(source,'','height=' + h1 + ',width=' + w1 + ',top=10,left=0');
}
// stop hiding -->
</script>
</head>
<body>
<p><a href="javascript:selectWin('_blank.htm?image=large.jpg&height=276&width=500',276,500)"><img border="2" src="small.jpg" alt="large.jpg (24095 bytes)" width="100" height="55"></a></p>
</body>
</html>