Recently, I have been programming in JavaScript, and I used json and wrote an array [{'id':'key_01','name':'university'},{'id':'key_02','name':'direct card delivery' },{'id':'key_03','name':'newborn'},{'id':'key_04','name':'change'},{'id':'key_05','name ':'Dynamic zone card'},{'id':'key_06','name':'stock'},{'id':'key_07','name':'Feixin'},{'id': 'key_08','name':'Mobile video'},{'id':'key_09','name':'School communication'},];
Looping to select in the page, but in ie8 it keeps prompting that the id is missing and undefined, which is OK in other browsers. Later, using ie8's js debugging, it was found that its array length was higher than that in other browsers The length of the array is 1, but the actual viewing of the array does not have that many values. Later, I looked carefully and found that there was an extra comma at the end of the array, so I just need to remove the comma.
It turns out that the method of ie8 obtaining the actual value and length is different. You cannot add extra commas at the end of the array.