I have the following code, which i've simplified, where $currEl
gets logged and displays correctly, but in the $.ajax call it logs as null
.
Am I missing something?
for(var i=0, j = atgSlots.length; i < j; i++) {
var currSlot = atgSlots[i].split('|'),
$currEl = currSlot[0].length ? $('[data-atg-url=' + currSlot[0] + ']') : null,
wcmLocation = currSlot[2] || null;
if ($currEl !== null && wcmLocation !== null) {
console.log($currEl);
$.ajax({
url: wcmLocation,
success: function(html) { console.log($currEl); updateSlots.setContent($currEl, html); },
error: updateSlots.checkDefault
}); // $.ajax
}
} // for : atgSlots