In Spring MVC and Jackson I have a really big Java object that I parse to a JSON string myBigJSONString (~1MB) and inline it into my HTML.
Then in my Javascript I do a JSON.parse(myBigJSONString) and everything works dandy.
However if I were to inline an syntactically correct Javascript object into my HTML and not a string representation thereof, my Javascript wouldn't have to read this huge string and parse it. It would already be parsed.
Question: How do I create a Javascript object from my Java object and inline it directly without going through a JSON string?
EDIT:
This is how my finished HTML looks right now:
var staticDataString = '[{\"propertyA\":\"valueA\"}, {\"propertyB\":\"valueB\"}]';
var staticData = JSON.parse(staticDataString);
This is how i want it to look
var staticData = [{propertyA:"valueA"}, {propertyB:"valueB"}];