I am trying to make kind of online gallery, this is first .html doc and when I click on one of image thumbnail it should open html with that image full size in gallery.html
<html >
<head>
<title>Untitled Document</title>
</head>
<body >
<a href="gallery.html?image1.jpg"> <img height="85" width="85" src="image1.jpg" /> </a>
<a href="gallery.html?image2.jpg"> <img height="85" width="85" src="image2.jpg" /> </a>
<a href="gallery.html?image3.jpg"> <img height="85" width="85" src="image3.jpg" /> </a>
</body>
</html>
gallery.html
<html>
<head>
<script language = "javascript">
function getUrl(){
var url = window.location.search;
path = url.substring(1);
changeImage(path);
}
function changeImage(path){
var imgDest = document.getElementById("image");
var imgSrc = path;
imgDest.setAttribute("src", imgSrc);
}
</script>
<title>Galerry</title>
</head>
<body>
<img src="" id="image"/>
<br>
</body>
</html>
all images and .html docs are in same folder... also there are some .jpg images which names has spaces in them, so click on them puts %20 in adrress bar instead of the space, I know that %20 replaces space, but is the problem maybe there? I thought so, but it want load image with regular name too. Any idea how could I load these images?
regards
path = url.substring(1);getsimageX.jpgfrom the URL?