zl程序教程

您现在的位置是:首页 >  前端

当前栏目

jquery将一个表单序列化为一个对象的方法

jQuery方法对象 一个 表单 序列化
2023-06-13 09:15:13 时间

复制代码代码如下:


varaa=function(form){
varo={};
$.each(form.serializeArray(),function(index){
if(o[this["name"]]){
o[this["name"]]=o[this["name"]]+","+this["value"];
}else{
o[this["name"]]=this["value"];
}
});
returno;
}