I use jQuery ajax to load images from a URL, display them, and then put a button on top of each image.
The code works in firefox, but in chrome, the parent "photos" div that should have all children (one child div "photo" for each image received from the URL) is 0.
I tried read() and load() but nothing works. If I run alert($('#photos').children().size()); in the Chrome console, it will return the children. But when executed, it returns 0. Any ideas?
$(window).load(function () { $("p").text("The DOM is now loaded and can be manipulated."); //returns 0 in chrome, but 10 in firefox alert($('#photos').children().size()); $('#photos').children().each(function() { //do stuff
source share