var aa=function(form){
var o={};
$.each(form.serializearray(),function(index){
if(o[this['name']]){
o[this['name']] = o[this['name']]+,+this['value'];
}else{
o[this['name']] = this['value'];
}
});
return o;
}
只要传递一个form对象进去就可以.经过方法处理就可以返回一个对象.例如console.info(aa($(#myform)));可以把这个在火狐浏览器里面试试效果.很好的一个方法.
