Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

captions

edited July 2014 in Fresco
I have 9 images on a page, each of which when clicked show the thumbnails okay and let the user scroll through the images in a particular folder.
The initial images and the thumbnails are dynamically read from a folder with PHP.
I am also using PHP to read the exif data from the images and am trying to display this as a caption. When I do this only a few of the images show the gallery when clicked.
I am using...
{url: 'images/gallery/<?php echo $galleryname; ?>/<?php echo imagename; ?>', caption: '<?php echo $caption; ?>'}
...which doesn't work but...
{url: 'images/gallery/<?php echo $galleryname; ?>/<?php echo imagename; ?>', caption: 'this is a caption'}
...does work.
Can anyone tell me where I am going wrong?

Comments

  • edited July 2014
    Having a quote in your string breaks the javascript string early, since it also uses single quotes. Google for examples on escaping quotes with php for a fix.
  • Of course! Can't believe I missed that - I was looking for something way more complicated that was causing the problem. Sometimes the obvious isn't obvious :)
    Thanks for pointing me in the right direction
Sign In or Register to comment.