对于以下表单来说,
<form>
<input type=text name=text1 value=1 />
<input type=text name=text2 value=2 />
</form>
(1)$('form').serialize()
'text1=1&text2=2'
(2)$('form').serializeArray()
[{name:'text1',value:'1'},{name:'text2',value:'2'}]
对于以下表单来说,
<form>
<input type=text name=text1 value=1 />
<input type=text name=text2 value=2 />
</form>
(1)$('form').serialize()
'text1=1&text2=2'
(2)$('form').serializeArray()
[{name:'text1',value:'1'},{name:'text2',value:'2'}]