Its easy to load JSON into an object in javascript using eval or JSON.parse.
But if you have a proper \"class\" like function, how do you get the JSON data into it?<
Easiest way is to use JSON.parse to parse your string then pass the object to the function. JSON.parse is part of the json2 library online.
JSON.parse