`; $(parent + ' .sailthru-list').append(elem); } //end of if(img...) } // end of if(url...) }); //end of $.each $(parent + ' .sailthru-list').bxSlider({ minSlides: 1, maxSlides: 4, slideWidth: 300, moveSlides: 1, controls: true, nextText: '', prevText: '', pager: false }); $(parent + ' h2.sailthru-h2').show(); } //end of if jsonArr.length > 0 else { console.log('no pdps returned'); // console.log(data); } }; Sailthru.personalize({ sections: [ /* { id: id_popular, selector: '.sailthru-popular .sailthru-list', onSuccess: function(data) { console.log('sailthru recommended pdps for popular & trending'); console.log(data); x(data, '.sailthru-popular'); $('#pdp-item-suggestions').after($('.sailthru-pdps')); }, onError: function(err) { console.log('sailthru recommended pdps popular & trending error'); console.log(err); } }, */ { id: id_context, selector: '.sailthru-context .sailthru-list', onSuccess: function(data) { console.log('sailthru recommended pdps for context'); console.log(data); x(data, '.sailthru-context'); $('#pdp-item-suggestions').after($('.sailthru-pdps')); }, onError: function(err) { console.log('sailthru recommended pdps context error'); console.log(err); } }, /* { id: id_purchased, selector: '.sailthru-purchased .sailthru-list', onSuccess: function(data) { console.log('sailthru recommended pdps for purchased & viewed'); console.log(data); x(data, '.sailthru-purchased'); }, onError: function(err) { console.log('sailthru recommended pdps purchased & viewed error'); console.log(err); } }, { id: id_interest, selector: '.sailthru-interest .sailthru-list', onSuccess: function(data) { console.log('sailthru recommended pdps for interest & prediction'); console.log(data); x(data, '.sailthru-interest'); }, onError: function(err) { console.log('sailthru recommended pdps interest & prediction error'); console.log(err); } }, */ ], vars: { "context_key": theURL }, }); });