Search code examples
javascriptjqueryopenlayerschromiumprettyphoto

Chromium JavaScript (PrettyPhoto / OpenLayers) href results in blank



I'm trying to link to an URL and it results in about:blank, but only in Chromium, not Firefox. I know that it worked, because I have an old website where it worked, but it doesn't with an up-to-date Chromium. Here is some Code.

<!-- PrettyPhoto -->
<a href="img_2014-05-01T10:52:46.jpg" rel="prettyPhoto[pp_gal]" title="Description"><img src="thumb_2014-05-01T10:52:46.jpg" alt="2014-05-01 10:52 &lt;a href=&quot;2014-05-01T10:52:46.jpg&quot; target=&quot;_blank&quot;&gt;(Original size)&lt;/a&gt;" width="67" height="100" /></a>

It is supposed to open the image in PrettyPhoto gallery (which it does) and then write "DATE (Original size)" as title. Firefox opens the full size image on click, Chromium just about:blank.

Same with OpenLayers: I add a layer with

var photos = new OpenLayers.Layer.Text("Photos", {location:"./gpx_photos.txt", projection: epsg4326});
map.addLayer(photos);

Example line from gpx_photo.txt:

lon lat title description icon  iconSize 
-79.0536638888889 43.1594277777778  2014-05-01  <html><a href="2014-05-01T10:52:46.jpg" target="_blank"><img src="lmap_2014-05-01T10:52:46.jpg" width="121" height"180" /></a></html>  map_2014-05-01T10:52:46.jpg 14,20

Same result: Firefox opens the full-size image, Chromium just about:blank.

Chromium version: chromium 35.0.1916.114-1 Firefox version: 29.0.1-2

Unfortunately, I don't remember the working Chromium version, but the old website is circa 1 year old => it worked then.

Do you see a mistake on my site, or know a workaround? Thanks for your help.


Solution

  • So, I found the solution: the links must look like this to work in Chromium, too: (notice the ./ in front of the image)

    <!-- PrettyPhoto -->
    <a href="./img_2014-05-01T10:52:46.jpg" rel="prettyPhoto[pp_gal]" title="Description"><img  src="./thumb_2014-05-01T10:52:46.jpg" alt="2014-05-01 10:52 &lt;a href=&quot;./2014-05-01T10:52:46.jpg&quot; target=&quot;_blank&quot;&gt;(Original size)&lt;/a&gt;" width="67" height="100" /></a>
    

    I updated the example page, so that the first gallery element doesn't work but the second does.