Skip to content Skip to sidebar Skip to footer

Simple Json Parse Error, Not Sure What Went Wrong

I have this mock JSON data that I prepared in javascript that I was planning to use later but it seems when I run the project I get an error in the console as stated below. PS: the

Solution 1:

Well, your json has an invalid format. Use a tool like jsonlint to debug your json.

Json has a very strict format. In your case you don't have quotes around the keys, which is not valid. Your correct json would be:

{"cinemaList":[{"cinemaName":"Causeway Point","locationLat":0,"locationLong":0,"dateList":[{"showDate":"Sep26, 1995","timeSlotList":[{"showTime":"4.00 PM"},{"showTime":"5.00 PM"}]}]},{"cinemaName":"JEM"}]}

See json.org for some excellent graphs on how json is expected to be. The rules that are relevant here are:

object  -> {} | { members }
members -> pair | pair , members
pair    -> string : value
string  ->"" | " chars "

Post a Comment for "Simple Json Parse Error, Not Sure What Went Wrong"