What is the difference between this?
$("form").serialize();
and this?
var theForm = $("form");
$(theForm[0]).serialize();
How do you get the second sample to serialize like开发者_运维问答 the first one?
try this:
var theForm = $("form");
theForm.eq(0).serialize();
First one selects all forms and serializes all form fields.
Second one selects form fields from FIRST form and serializes them
Or you could use in one line:
$("form:first").serialize();
精彩评论