A quick overview of the situation:
For simplicity of complicated data, I've got a series of JavaScript objects (built using function Object Factories) that handle auditing data, so for example, you have a child object inside a parent object inside a user object (these are basically arrays). These objects contain functions that help process the data they contain, both in and out, when in the UI.
On the top level, a single JSON function call pulls the data the objects contain out, without the functions (which is what I want to happen, as only the data is stored in an external database).
The problem
However, on pulling the information back from the database, using JSON.parse and assigning the result into the top level object holder obviously only contains just the data, no functions.
Bearing in mind the object arrays won't be initialised (as they won't know the length until extracted from the JSON data), how can I reinsert the JSON data back into the objects, functions included?
Is there some way of saying to the parser 'for this level of data, use this object, for this level, use this one'?
[Note: due to the nature of the organisation and security, external libraries aren't permitted. No jQuery suggestions etc.]