knockout.js save form to json
问题 I have my form mapped using knockout.js and mapping plugin. I am ready to save the form to json and send it back to the server. This is my first time doing this so what is the simplest way to do it? Here is what I have so far: // Here's my data model var viewModel; $.getJSON('/myJSONdata', function (data) { viewModel = ko.mapping.fromJS(data); ko.applyBindings(viewModel); }); //convert mapped data to json format var jsonData = ko.mapping.toJSON(viewModel); // Do something to send the form