const feedImages = $('.feed-image');
$(document).ready(function() {
$.get('https://us-central1-codesmith-curriculum-server.cloudfunctions.net/app/images', function(data) {
for (let i = 0; i < data.length; i++) {
$(feedImages[i]).attr('src', data[i])
}
})
})
Hi all, I am making an Instagram clone. I am using a get request to get data from a URL. This URl contains an array of more URLS that are links to images. I used a for loop to iterate through the feedImages and the data to apply one data element to each feedImages src. Some of the links are broken. How can I filter through these broken links and exclude them? I tried using if (status !== 'success')
but they all return 'success' so that isn't working. Any advice is appreciated. Thanks!