开发者

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());
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜