Hateful ie8 prompt for missing id undefined

  • 2020-03-30 02:25:04
  • OfStack

I've been programming in javascript lately, using json, Wrote an array [{' id ':' key_01 ', 'name' : 'universities'}, {' id' : 'key_02', 'name' : 'straight to send CARDS'}, {' id ':' key_03 ', 'name' : 'new'}, {' id ':' key_04 ', 'name' : 'replacement'}, {' id ':' key_05 ', 'name' : 'm-zone sleeve'}, {' id ':' key_06 ', 'name' : 'inventory'}, {' id ':' key_07 ', 'name' : 'fetion'}, {' id ':' key_08 ', 'name' : 'mobile phone video'}, {' id ':' key_09 ', 'name' : 'school XunTong},];

Added to the select circulating in the page, but has been prompt in ie8 lacks id not definition, in other browsers are ok, and then using ie8 js debug, found his array length 1 larger than the array length in other browsers, and don't have much value and the actual view array, then look closely, found that the end of the array a comma, remove the comma.

The original ie8 to get the actual value and length of the method is different, can not be added at the end of the array extra commas.

Related articles: