I have some HTML that contains a JSON string. In the on DOM ready callback, I have something like this:
MyObject = JSON.parse($('#TheJsonString').html());
Later in my code, I write something this:
var SomeVar = MyObject.MyProp1;
And then when I run the code through the Google closure compiler, I get the warning
Property MyProp1 never defined on MyObject.
How should the code be written so that it doesn't generate a warning?