Use jQuery.each instead of d_count — IE8 returns true for a property with obj.hasOwnProperty compared to other browsers, resulting in a JavaScript error because d_count which is based on .hasOwnProperty is one too high, which means an array index is out of bounds.