IE8 支持属性或方法'forEach'
$('.tabs').tabs();
$('#search-consumables [data-ajax-call]').change(function() {
var $this = $(this),
settings = $this.data(),
$target = $(settings.target);
$.ajax({
type: 'GET',
url: 'index.php?route=module/quicklookup/' + settings.ajaxCall,
data: $this.closest('form').serializeArray(),
dataType: 'json',
success: function(data) {
var html = '';
$target.find(':not(.blank)').remove();
html = $target.html();
data.forEach(function(entry) {
html += '<option value="'+entry.id+'">'+entry.name+'</option>';
});
$target.html(html);
}
});
});
我试过了
$.each(data, function(entry) {
然而数据然后返回未定义,我错过了什么才能在 IE8 中工作?