The hateful ie8 prompt lacks the id undefined _ javascript tips-js tutorial
Source: Internet
Author: User
The page is added to the select statement cyclically. However, in ie8, the system always prompts that the id is missing and undefined. After testing, it is found that the last comma is added to the array, just remove the comma. Recently, javascript programming has been used. In json format, an array [{'id': 'key _ 01', 'name': ''} has been written '}, {'id': 'key _ 02', 'name': 'direct delivery card'}, {'id': 'key _ 03', 'name ': 'new'}, {'id': 'key _ 04 ', 'name': 'change the machine'}, {'id': 'key _ 05 ', 'name': 'dynamic motion zone cid'}, {'id': 'key _ 06', 'name': 'stock'}, {'id ': 'key _ 07', 'name': 'infant'}, {'id': 'key _ 08', 'name': 'mobile video '}, {'id': 'key _ 09', 'name':' '},];
The page is added to the select statement cyclically, but in ie8, it is always prompted that the id is missing and is OK in other browsers. Later, the js debugging of ie8 is used, it is found that the length of his array is 1 longer than the length of the array in other browsers, but the actual view of the array does not have so many values. Later, I checked it carefully and found that the array ended with a comma, just remove the comma.
The original method for obtaining the actual value and length in ie8 is different, and redundant commas cannot be added at the end of the array.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service