$(".selectedBatch").each(function(index){
var batchCode = $(this).text();
//edit batch attr start
$.ajax({
url: "../Controller/getBatchAttr.php",
type: "GET",
async: false,
data: "BM_Course_Code="+ batchCode,
success:function(resBatch){
console.log($(this).text());
//$(this).attr("data-commence-date",resBatch.BM_Commence_Date);
//$(this).attr("data-end-date",resBatch.BM_End_Date);
//$(this).attr("data-ins-days",resBatch.BM_Ins_Days);
}
});
//edit batch attr end
});
为什么console.log($(this).text());
在成功函数中返回空输出?