I am having an javascript issue where internet explorer 7 and 8 are giving an error in the console.
I think the the keys method maybe is not supported? This is the piece of code causing the problem:
if (count == Object.keys(aResults).length) {
if (typeof Object.keys === 'function') {
globalPriceGroupKey = Object.keys(globalPriceGroup[colorID]);
} else {
for (var key in globalPriceGroup[colorID]) {
globalPriceGroupKey.push(key);
}
}
//globalPriceGroup[colorID].sort( function numOrdA(a, b){ return (a-b); } );
globalPriceGroupKey.sort(function(a, b) {
return globalPriceGroup[colorID][a] - globalPriceGroup[colorID][b];
});
}
Is there anything I can do to this code to make it compatible with ie7/8?