Today when debugging a page encountered a problem, in IE9 executed a very good script, in the IE8 Open when the error pop:expected identifier, String ornumber, according to experience, should be defined when the object is the end of the last property followed by a comma, but after checking again did not find that there is such a situation, and then carefully looked at the location of the error, found that there is a definition of JSON Object properties, the property name is not in the practical cited, so add up to try again, the problem was conquered.
In summary, when an error occurs expected identifier, string or number, you should first check whether the last property followed by a comma when using the object literal, which is in JS The new handwritten code is more common, such as:
{' A ': ' Avalue ', ' B ': ' BValue ',}
, second, you should check that the literal attribute name is enclosed in an argument, and the error demonstrates the sample:
{A: ' Avalue ', B: ' BValue '}
Change to:
{' A ': ' Avalue ', ' B ': ' BValue '}
The problem has been overcome.