Jedidja
Jedidja

Reputation: 16970

Why is the JSON that flot expects no longer valid in JSONLint (and hence jQuery 1.4.x)?

Attempting to use the data series from this example no longer passes the JSONLint test. and as such attempting to use it with jQuery 1.4 fails. Specifically, returning it or data like it from an AJAX request as type json will cause jQuery to throw an error. I know this worked perfectly well with jQuery 1.3.x. Does anyone have a solution?

Upvotes: 1

Views: 397

Answers (1)

Pointy
Pointy

Reputation: 413966

The problem is that that pseudo-JSON doesn't quote object keys:

 // right
 { "something": "value" }
 // wrong
 { something: "value" }

It's OK to do that in Javascript, but JSON syntax is stricter than Javascript syntax.

Upvotes: 2

Related Questions