10 Star 11 Fork 5

microseer / xui

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
jquery.ba-serializeobject.js 783 Bytes
一键复制 编辑 原始数据 按行查看 历史
microseer 提交于 2014-03-18 12:00 . 导入源代码
/*!
* jQuery serializeObject - v0.2 - 1/20/2010
* http://benalman.com/projects/jquery-misc-plugins/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
// Whereas .serializeArray() serializes a form into an array, .serializeObject()
// serializes a form into an (arguably more useful) object.
(function($,undefined){
'$:nomunge'; // Used by YUI compressor.
$.fn.serializeObject = function(){
var obj = {};
$.each( this.serializeArray(), function(i,o){
var n = o.name,
v = o.value;
obj[n] = obj[n] === undefined ? v
: $.isArray( obj[n] ) ? obj[n].concat( v )
: [ obj[n], v ];
});
return obj;
};
})(jQuery);
JavaScript
1
https://gitee.com/bin-cn/xui.git
git@gitee.com:bin-cn/xui.git
bin-cn
xui
xui
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891