Note that there are some explanatory texts on larger screens.

plurals
  1. POjavascript doesnt load image from url
    text
    copied!<p>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</p> <pre><code>&lt;html &gt; &lt;head&gt; &lt;title&gt;Untitled Document&lt;/title&gt; &lt;/head&gt; &lt;body &gt; &lt;a href="gallery.html?image1.jpg"&gt; &lt;img height="85" width="85" src="image1.jpg" /&gt; &lt;/a&gt; &lt;a href="gallery.html?image2.jpg"&gt; &lt;img height="85" width="85" src="image2.jpg" /&gt; &lt;/a&gt; &lt;a href="gallery.html?image3.jpg"&gt; &lt;img height="85" width="85" src="image3.jpg" /&gt; &lt;/a&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>gallery.html</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script language = "javascript"&gt; 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); } &lt;/script&gt; &lt;title&gt;Galerry&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;img src="" id="image"/&gt; &lt;br&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>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?</p> <p>regards</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload