开发者

Google Closure - Form data to json object

开发者 https://www.devze.com 2023-03-27 17:26 出处:网络
Is it possible to get JSON开发者_如何学运维 from form data? I can get data map or string representation only.

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

精彩评论

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