Google Closure - Form data to json object
Is it possible to get JSON开发者_如何学运维 from form data? I can get data map or string representation only.
var form = goog.dom.getElement('myform');
console.log(goog.dom.forms.getFormDataString(form));
Simply convert the map to JSON:
var json = goog.json.serialize(goog.dom.forms.getFormDataMap(form).toObject());
精彩评论