Closed franciscop closed 8 years ago
You're right - quite honestly, I was just lazy about my terminology and inconsistent with the copy on the homepage. It's a JS object literal, and not JSON.
How about storing the "object" data in a separate .json file? You could import and JSON.parse()
the file as needed. This might improve maintainability by keeping data separate from application logic.
Yeah but now the question is whether or not the method also accepts a string to convert it to an object with JSON.parse(). But it'd be quite easy to do so and also quite useful.
Really cool experiment, I tried to do the same the other way around; inserting scripts into CSS. However, I have something to note. This is not JSON:
It's just a javascript object (also noted as literal object). It'd be JSON if it was all a big string, but in this way it's just an object. See one explanation and [another](http://stackoverflow.com/a/2904181/938236 %28reason 3%29).