Title: Image undefined
Last modified: December 12, 2017

---

# Image undefined

 *  [simooo](https://wordpress.org/support/users/simooo/)
 * (@simooo)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/image-undefined-2/)
 * Hi there,
 * Trying this plugin out but can’t get past the initial loading stage.
 * My gallery is failing to load with the two errors below. As you can see instead
   of a correct image URL it’s trying to load ‘undefined’. The second error I presume
   has to do with the image never loading in the first place.
 * `GET http://localhost:8080/k/site/show/projects/undefined 404 (Not Found)`
 *     ```
       jquery.finalTilesGallery.js?ver=3.3.30:714 Uncaught TypeError: Cannot read property 'width' of undefined
           at Plugin.add_to_final (jquery.finalTilesGallery.js?ver=3.3.30:714)
           at Plugin.add (jquery.finalTilesGallery.js?ver=3.3.30:639)
           at Plugin.nextTile (jquery.finalTilesGallery.js?ver=3.3.30:423)
           at Image.img.onerror (jquery.finalTilesGallery.js?ver=3.3.30:499)
       ```
   
 * This is my markup:
 *     ```
       <div class="final-tiles-gallery">
           <div class="ftg-items">
             <div class="tile">
               <a class="tile-inner" href="http://localhost:8080/k/site/wp-content/uploads/2017/12/INESTABLES-1-500x281.jpg">
                 <img class="item" src="http://localhost:8080/k/site/wp-content/uploads/2017/12/INESTABLES-1-500x281.jpg" data-src="http://localhost:8080/k/site/wp-content/uploads/2017/12/INESTABLES-1-500x281.jpg" />
             </a>
           </div>
         </div>
       </div>
       <script type="text/javascript" charset="utf-8">
         jQuery(document).ready(function() {
           jQuery('.final-tiles-gallery').finalTilesGallery({
             margin: 20,
             gridSize: 40,
             layout: 'final'
         });
       });
       </script>
       ```
   
 * Any help much appreciated. Cheers!

Viewing 11 replies - 1 through 11 (of 11 total)

 *  [Diego](https://wordpress.org/support/users/greentreelabs/)
 * (@greentreelabs)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/image-undefined-2/#post-9776645)
 * Hi,
 * are you able to publish this page online? There’s not much I can do. The url “
   [http://localhost:8080/k/site/show/projects&#8221](http://localhost:8080/k/site/show/projects&#8221);
   it’s not even in the markup you posted.
 * Cheers,
    Diego
 *  Thread Starter [simooo](https://wordpress.org/support/users/simooo/)
 * (@simooo)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/image-undefined-2/#post-9777142)
 * Hi Diego! Thanks for getting back so quickly. I’m in the middle of building the
   site and am trying out different plugins, so unfortunately I only have my local
   version right now.
 * Would you be able to give me any pointers for debugging the javascript in the
   meantime? Any ideas why the URL would resolve to just “undefined”?
 * I wasn’t quite clear on what you meant by “it’s not even in the markup you posted”–
   do you mean that something is wrong or missing in the markup?
 * Cheers!
 *  Thread Starter [simooo](https://wordpress.org/support/users/simooo/)
 * (@simooo)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/image-undefined-2/#post-9777599)
 * Hi again,
 * I’ve managed to get a temporary version of this online:
    [http://kevinspeight.balthazaurus.com/show/projects](http://kevinspeight.balthazaurus.com/show/projects)
 * As before there’s only 1 image in the gallery and the JS errors and the markup
   are the same as the ones I pasted earlier.
 * I think I just understood the second part of your earlier reply – were you asking
   about the URL in the 404 Not Found error? It’s the URL of the gallery page with
   the word ‘undefined’ tagged on at the end. I think this is what the plugin tries
   to use as an image URL.
 * Hope this helps!
 *  [Diego](https://wordpress.org/support/users/greentreelabs/)
 * (@greentreelabs)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/image-undefined-2/#post-9778783)
 * I don’t understand what you’re doing. Why did you statically/manually write the
   markup and the initialization code?
 *  Thread Starter [simooo](https://wordpress.org/support/users/simooo/)
 * (@simooo)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/image-undefined-2/#post-9779000)
 * Hi there,
 * What’s the confusing part? I’m following the example in the documentation here.
   
   [https://www.final-tiles-gallery.com/documentation](https://www.final-tiles-gallery.com/documentation)
 * My markup is generated through PHP though. I’m using a standard WordPress loop
   in a category archive.
 * Cheers
 *  [Diego](https://wordpress.org/support/users/greentreelabs/)
 * (@greentreelabs)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/image-undefined-2/#post-9779018)
 * No, I mean what did you do on your site. That markup it’s not the one you get
   when you use the shortcode [FinalTilesGallery id=”1″]
 *  Thread Starter [simooo](https://wordpress.org/support/users/simooo/)
 * (@simooo)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/image-undefined-2/#post-9779042)
 * Sorry I just edited my previous reply to be clearer. I’m using a WordPress loop
   to generate the gallery.
 * I’ve followed the documentation here:
    [https://www.final-tiles-gallery.com/documentation](https://www.final-tiles-gallery.com/documentation)
 *  [Diego](https://wordpress.org/support/users/greentreelabs/)
 * (@greentreelabs)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/image-undefined-2/#post-9779080)
 * the xdata-src it’s wrong, it should be data-src
 *  Thread Starter [simooo](https://wordpress.org/support/users/simooo/)
 * (@simooo)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/image-undefined-2/#post-9779138)
 * Sorry, the X was just there to “disable” the `data-src` attribute, to see if 
   the problem was that I had both `src` and `data-src`.
 * I’ve just changed it to `data-src` and I’m getting the same error. The only difference
   is that the 404 is now for just ‘undefined’ instead of the longer URL.
 *  [Diego](https://wordpress.org/support/users/greentreelabs/)
 * (@greentreelabs)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/image-undefined-2/#post-9779159)
 * sorry it’s data-ftg-src
 * you’re reading the jQuery version docs and using the WordPress version, is there
   a reason about it?
 *  Thread Starter [simooo](https://wordpress.org/support/users/simooo/)
 * (@simooo)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/image-undefined-2/#post-9779247)
 * Oh ok! Yes, with the data-ftg-src attribute it’s loading.
 * Are the versions running different JavaScript code? Am I better off using the
   jQuery version if I want to do this manually instead of through shortcodes?
 * I haven’t ruled out doing it using shortcodes, it just seemed easier to do it
   manually since I had everything set up this way.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Image undefined’ is closed to new replies.

 * ![](https://ps.w.org/final-tiles-grid-gallery-lite/assets/icon.svg?rev=3184352)
 * [Image Photo Gallery Final Tiles Grid](https://wordpress.org/plugins/final-tiles-grid-gallery-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/final-tiles-grid-gallery-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/final-tiles-grid-gallery-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/final-tiles-grid-gallery-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/final-tiles-grid-gallery-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/final-tiles-grid-gallery-lite/reviews/)

 * 11 replies
 * 2 participants
 * Last reply from: [simooo](https://wordpress.org/support/users/simooo/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/image-undefined-2/#post-9779247)
 * Status: not resolved