Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json2.js throwing SyntaxError: JSON.parse while parsing !! #73

Closed
uacharya opened this issue Jan 15, 2016 · 1 comment
Closed

json2.js throwing SyntaxError: JSON.parse while parsing !! #73

uacharya opened this issue Jan 15, 2016 · 1 comment

Comments

@uacharya
Copy link

I have a json object that is stringified and this is how it looks like (small part of the object):

[{"name":"ArrayInterpolator","size":1983,"parent":{"$ref":"$["children"][11]"},"depth":3,"value":1983,"x":0.8257659609894478,"y":204,"dx":0.0130312504527497,"dy":68,"sum":1983,"key":"animate.interpolate.ArrayInterpolator","fill":{"l":86.88283782905027,"a":-54.085032053595995,"b":48.724495533444134,"brighter":function (n){return new hn(Math.min(100,this.l+Ga_(arguments.length?n:1)),this.a,this.b)},"darker":function (n){return new hn(Math.max(0,this.l-Ga_(arguments.length?n:1)),this.a,this.b)},"rgb":function (){return gn(this.l,this.a,this.b)},"toString":function (){return this.rgb()+""}}}

The problem is that this object is parsed fine if the "brighter", "darker","rgb","toString" properties are removed but when they are added it generates SyntaxError: JSON.parse. I need these properties to run my d3 page accurately. Is there any way this js can be modified to parse these properties as well ?

@douglascrockford
Copy link
Owner

JSON is a formally defined data interchange format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants