문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top