View Full Version : displaying a selected image on a page

Mar 11th, 2007, 04:33 PM
can anyone point me in the direction of a snippet.

i want to pass the variable of an image and display it on a html page

like image.html?id=test.jpg

Mr J
Mar 11th, 2007, 05:40 PM
Place this basic example script in the head section of image.html

<script type="text/javascript">

var dataPassed = ""
if (location.search.length > 0){
dataPassed = unescape(location.search.substring(1))
document.write("<img src=\""+dataPassed+"\">")


You link would then be

<a href="image.html?test.jpg">Test Image</a>

For more indepth examples see


and scroll down the page a bit