var slides = []; $.ajax({ url: 'json/slider1.json', dataType: 'json', success : function(r,s){ for(var i = 0;i