I have a nested loop written in jquery and return false inside my child loop keeps appending the same text to the parent row. My code,
$('#listingProducts ul.msRows li.msFullfillment').each(function(index) {
if(typeof $('#hfOrd'+index).val() != 'undefined'){
var $this = $(this);
var orderId = $('#hfOrd'+index).val();
// repainting logic
$('body').append(data);
$('#ajaxProducts ul.displayPoints li').each(function(index){
var $child = $(this);
if(typeof $('#hfAjaxOrderId'+index).val() != 'undefined'){
var ajaxOrderId = $('#hfAjaxOrderId'+index).val();
//alert(orderId+' '+ ' '+ajaxOrderId);
if(ajaxOrderId === orderId){
// replace the div here..
var anchorText = $child.find("#pointsLineAjax .redeem").text();
$this.find("#pointsLine .redeem").text(anchorText);
return false;
}
}
});
}
});
Return false inside child loop doesnt go back to the parent. That doesnt seem to write it to the corresponding row. What am i missing here..