javascript - Exclude blank images in JQuery carousel -


i'm trying work bit of code pulls list of new book titles our library catalog , uses create jquery carousel. builds url image src each title using book's isbn number. issue not every book on new title list has isbn , don't have cover image. there can add make titles don't have cover image not added carousel? have limited jquery experience haven't been able figure out.

$.each( records.hitlisttitleinfo, function () {     $("<img/>").attr("src", coverurlprefix + this.isbn[0] + coverurlsuffix).attr("alt",     this.author).attr("title", this.title).addclass("cloudcarousel").appendto("#carousel1"); }); 

$(record.hitlisttitleinfo).not( function(index, element) {     var isbn = this.isbn[0]     return isbn == null || isbn.length == 0; // true means it's removed }).each( {     $("#carousel1").attr("src", coverurlprefix + this.isbn[0] + coverurlsuffix)         .attr("alt", this.author)         .attr("title", this.title)         .addclass("cloudcarousel"); }); 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -