Colon error when importing JSON file into a HTML Document

2038 views html
3

If I write my JSON file like this:

{
  "content":{
    "39e3e5":{
      "date":"20070725",
      "img":"linkgoeshere",
      "title":"eclipse iss",
      "link":"vsdvsd7"
    }
  }
}

I get error on all the colons:

SyntaxError: Unexpected token :

But if I change all the colons to semicolons it works just fine.

{
  "content";{
    "39e3e5";{
      "date";"20070725",
      "img";"linkgoeshere",
      "title";"eclipse iss",
      "link";"vsdvsd7"
    }
  }
}

Can anyone tell me Why and how I can fix it?

answered question

1 Answer

4

I think you have to write the name of the var without the "

posted this

Have an answer?

JD

Please login first before posting an answer.