February 3, 201313 yr Hi all, i am using ajax to get objects $.ajax({ url: 'server/php/', type: 'get', dataType: 'json', error: function(data){ }, success: function(data){ alert(data); var name= data.files[0]['name']; console.log(name); var size = data.files[0]['size']; console.log(size); var url=data.files[0]['url']; console.log(url); var thumbnail_url = data.files[0]['thumbnail_url']; console.log(thumbnail_url); var delete_url = data.files[0]['delete_url']; console.log(delete_url); var delete_type = data.files[0]['delete_type']; console.log(delete_type); } }); As You can see it will only get the first group of objects [0] how can i put a loop in for each image available Thanks
February 3, 201313 yr Hello, please I'm try to make a block list that changes/hovers from one block to another in d same container without mouseover like the one on the www.bet.com (news container) and I don't know how to go about it. Please I will be very glad if you can help me out.
February 4, 201313 yr if (Array.isArray(data.files)) { data.files.forEach(function (file) { console.log(file); }); } Essentially, that's how you want to do it.
February 4, 201313 yr Author if (Array.isArray(data.files)) { data.files.forEach(function (file) { console.log(file); }); } Essentially, that's how you want to do it. Pefect timing and it works great thank you +1
Create an account or sign in to comment