How do I convert all elements of my form to a JavaScript object?
(如何将表单的所有元素转换为JavaScript对象?)
I'd like to have some way of automatically building a JavaScript object from my form, without having to loop over each element.
(我希望有一些方法可以自动从表单中构建JavaScript对象,而不必遍历每个元素。)
I do not want a string, as returned by $('#formid').serialize();
(我不需要$('#formid').serialize();
返回的字符串$('#formid').serialize();
)
, nor do I want the map returned by $('#formid').serializeArray();
(,也不希望$('#formid').serializeArray();
返回的地图)
ask by community wiki translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…