源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

jquery form表单序列化为对象的示例代码

  • 时间:2020-03-03 10:48 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:jquery form表单序列化为对象的示例代码
[u]复制代码[/u] 代码如下:
$.fn.serializeObject = function() { var o = {}; var a = this.serializeArray(); $.each(a, function() { if (o[this.name]) { if (!o[this.name].push) { o[this.name] = [ o[this.name] ]; } o[this.name].push(this.value || ''); } else { o[this.name] = this.value || ''; } }); return o; }
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部