[Solved] Script error, where to add if
I notice your usage of “photos”, but I don’t see the variable being declared anywhere… At least, inside the main function (since it won’t be global), declare your photos var: var photos = []; Aditionally, like Chris says, always check if the var is defined. 🙂 Source: https://stackoverflow.com/a/17748905/2599797 if (photos) // Simple if (typeof(photos) != … Read more