user49126
user49126

Reputation: 1863

Firefox JSON format error

When I execute the JSON formated code below, Firefox v20 will throw a SyntaxError: invalid label error.

{
    "aa": "bb"
}

but when I validate it using http://jsonlint.com/ it seems to be valid. So why is Firefox behaving like this ?

Upvotes: 0

Views: 72

Answers (1)

Jim Cote
Jim Cote

Reputation: 1756

You have to place objects in places that are syntactically correct. For example, you can create an object like so:

var a = {"aa": "bb"};

Or you could pass that object to a function like:

func({"aa": "bb"});

Upvotes: 1

Related Questions