The Knockout MVVM framework makes it dirt simple to serialize your ViewModels to JSON:
ko.toJSON(viewModel);
However, if you’re wondering why some observables aren’t being serialized, note that observables that are initialized empty aren’t serialized to JSON. So if your … Read on...