4

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) { 

それでも data は undefined を返します。これを IE8 で動作させるには何が欠けていますか?

4

1 に答える 1