I know how to use JSON to create objects, but there doesn\'t seem to be away to use JSON to create an object that is of a specific object type.
Here\'s an example of an
You can derive an object from theirs. Your constructor can accept the object you want, but call their constructor in an unaffected fashion:
function yourWrapper(obj) {
theirObject.call(this);
for (var s in obj) {
this[s] = obj[s];
}
}
yourWrapper.prototype = new theirObject();
Or something like that :)