SCRIPT438: Object doesn't support property or method 'forEach'
ajax, internet-explorer-8, javascript, json
Solution
The first argument passed to the `jQuery.each` callback is the index of the value in the array; the second argument is the actual value.
Try using:
$.each(data, function(i, entry) {
// your code here
});
Problem
IE8 support property or method '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); } }); }); ``` I have tried ``` $.each(data, function(entry) { ``` yet data then returns undefined, What am I missing to get this working in IE8?