1

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?

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265
Jedidja
  • 16,610
  • 17
  • 73
  • 112
  • What exactly is the Lint error? (edit) o i c – Pointy Mar 03 '10 at 15:27
  • Ok I guess the data would have never passed the JSONLint test. jQuery 1.3 didn't do any evaluation on "valid" JSON data apart from window["eval"]("(" + data + ")"); – Jedidja Mar 03 '10 at 15:42

1 Answers1

2

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.

Pointy
  • 405,095
  • 59
  • 585
  • 614