0
的下面的代码,我想创建一个JavaScript对象的线,给了我下面的错误:错误创建Javascript对象
Uncaught SyntaxError: Unexpected token {
这是代码行:
var flyer2 = {"id":20,"img_url":"http://images.awfbeat.com/48395b02-59e5-4e26-b7bc-8c603008c9c4","img_width":0,"img_height":0,"popularity":0,"color":"#67c547","tag":"Jul 10","category":"festivals","title":"Darth Vader\\\u0027s \\\"Annihilator\\\"","title_slug":"darth-vader-s-annihilator-","performer":"","performer_sort":"xxxx","posted":"2012-03-11 04:09:20.0","facebook_event_id":"","venue_postal":"90802","venue_name":" Aquarium of the Pacific","venue_street":"100 Aquarium Way","venue_city":"Los Angeles","venue_region_abbr":"CA","venue_lat":"33.762226","venue_lng":"-118.19686","needs_info":false};
我究竟做错了什么?
在你真实的代码中是'"'...?至少把它改成'''。 – 2012-03-11 09:57:31
As @ rob-w said,remove your "。这里有一个有用的工具来验证你的JSON数据:[JSONLint](http://jsonlint.com/) – Guumaster 2012-03-11 12:37:24