1. 首页
  2. 移动开发
  3. WindowsPhone
  4. 将form表单中的元素转换成对象的方法适用表单提交

将form表单中的元素转换成对象的方法适用表单提交

上传者: 2020-12-13 09:33:23上传 PDF文件 15.66KB 热度 3次
代码如下: function serializeObject(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; }
下载地址
用户评论