Thumbnails and images

windows

Guest
I have a page with a lot of text. On that page I want to insert a small picture (thumbnail). When the user clicks that image, I want to show a page with a larger picture of that thumbnail. So far so good.<br />
<br />
But I want to use the same page to display all of the big images. So when I click on "thumb1" on "Page1", I want to show "BigPage" with "BigPicture1"; when I click on "thumb2" on "Page1", I want to show "BigPage" with "BigPicture2"; when I click on "thumb3" on "Page2", I want to show "BigPage" with "BigPicture3"; and so on...<br />
<br />
How do I use the same page with a different image, depending on where I started from?<br />
<br />
Thanks<!--content-->in the link to the next page, you can add an argument to the URL:<br />
<br />
<br />
<a href='http://www.htmlforums.com/archive/index.php/next.html?argument=value'>Click Here</a><br />
<br />
<br />
you can then use javascript in the next.html page:<br />
<br />
Code:
<br />
<script type='text/javascript'><br />
<!--<br />
<br />
  var ArgIdx = location.indexOf("="); // find start of first arg<br />
<br />
  var Pic = location.substring(ArgIdx + 1, location.length);<br />
<br />
<br />
  function include_picture()<br />
  {<br />
    document.write("<img src='http://www.htmlforums.com/archive/index.php/images/" + Pic + ".jpg'" alt='" + Pic + "'>");<br />
  }<br />
<br />
--/><br />
</script><!--content-->I tried the code, but there is something wrong. I get the error message "Error: ')' expected". This is the code I used. What am I doing wrong?<br />
<br />
[First Page]<br />
<HTML><br />
<HEAD><br />
</HEAD><br />
<BODY><br />
<DIV Align="Center"><U><B>Small Picture on first Page</B></U></Div><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><br />
<A HRef=http://www.htmlforums.com/archive/index.php/"BigPicture.htm?Picture=JebelAkakus.jpg">This is the small Picture</A><br />
</Body><br />
</HTML><br />
<br />
<br />
<br />
[Second Page]<br />
<HTML><br />
<HEAD><br />
<script type='text/javascript'><br />
<!--<br />
var ArgIdx = location.indexOf("="); // find start of first arg<br />
var Pic = location.substring(ArgIdx + 1, location.length);<br />
<br />
function include_picture()<br />
{<br />
Document.write("<img src='http://www.htmlforums.com/archive/index.php/" + Pic + ".jpg'" alt='" + Pic + "'>");<br />
}<br />
<br />
--/><br />
</script><br />
</HEAD><br />
<BODY><br />
<DIV Align="Center"><Font size="+1" face="Times New Roman, Times, serif" color="#0000FF"><U><B>Big Picture on second Page</B></U></Font></Div><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><br />
<Font size="+1" face="Times New Roman, Times, serif" color="#0000FF">This is the BIG Picture</Font><br />
<BR><BR><br />
<br />
<script type='text/javascript'><br />
include_picture();<br />
</script><br />
<br />
</Body><br />
</HTML><!--content-->did you get a line number with the error?<br />
<br />
ahh - I see the problem:<br />
<br />
<br />
This is wrong:<br />
<br />
document.write("<img src='http://www.htmlforums.com/archive/index.php/images/" + Pic + ".jpg'" alt='" + Pic + "'>");<br />
<br />
<br />
It should be:<br />
<br />
document.write("<img src='http://www.htmlforums.com/archive/index.php/images/" + Pic + ".jpg' alt='" + Pic + "'>");<br />
<br />
<br />
Spot the difference?<br />
I'll give you a clue, its between the jpg and the alt.<br />
<br />
sorry - my typo there<!--content-->As they say, sometimes it纾
 
Back
Top