我需要暂停 .each 循环,让 iframe 有时间加载。有没有办法做到这一点?我研究了回调等等,但没有运气。我不想超时,因为我需要确保 iframe src 完全加载。
$.ajax({
type:'post',
traditional: true,
url: '/Reportedit/exportPdfCharts',
dataType: 'json',
cache: 'false',
contentType: 'application/json; charset=utf-8',
success: function(data) {
$.each(data, function() {
var url = "/Reportedit/createonechart";
$("#iframe-chart").attr("src", url);
//NEED TO PAUSE HERE UNTIL iframe source has completely loaded.
});
}
});