{"id":484,"date":"2011-12-31T13:28:29","date_gmt":"2011-12-31T13:28:29","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=484"},"modified":"2011-12-31T13:28:29","modified_gmt":"2011-12-31T13:28:29","slug":"javascript-7-error-expected-identifier-string-number","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/javascript-7-error-expected-identifier-string-number\/","title":{"rendered":"JavaScript &#8211; IE 7 Error: Expected identifier, string or number"},"content":{"rendered":"<p>This is a common error when debugging JavaScript for the IE 7 and earlier IE browsers. Essentially, it appears that IE 7 is a little more strict on syntax than IE 8 and it&#39;s successors.<\/p>\n<p>While this error is not specific to JSON formatted objects, it can occur when they are not syntactically correct. When dealing with JavaScript Object Notation, ensure that you don&#39;t have any &quot;trailing commas&quot;. For instance, the following will throw an error in IE 7:<\/p>\n<p><code>var&nbsp; customLayout: {<br \/>\n\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &#39;test1&#39; : [ &#39;0 1 2 3 4 5 6 7 8 9&#39;],<br \/>\n\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &#39;test2&#39; : [ &#39;q w e r t y u i o p&#39;],<br \/>\n\t}<br \/>\n\t<\/code><\/p>\n<p>Whereas, this JSON object is valid (notice that the final element is not suffixed by a comma:<\/p>\n<p><code>var&nbsp; customLayout: {<br \/>\n\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &#39;test1&#39; : [ &#39;0 1 2 3 4 5 6 7 8 9&#39;],<br \/>\n\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &#39;test2&#39; : [ &#39;q w e r t y u i o p&#39;]<br \/>\n\t}<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a common error when debugging JavaScript for the IE 7 and earlier IE browsers. Essentially, it appears that IE 7 is a little&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[77,5],"tags":[154,153],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/484"}],"collection":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/comments?post=484"}],"version-history":[{"count":2,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/484\/revisions"}],"predecessor-version":[{"id":486,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/484\/revisions\/486"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=484"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}