1// 2// Use internal $.serializeArray to get list of form elements which is 3// consistent with $.serialize 4// 5// From version 2.0.0, $.serializeObject will stop converting [name] values 6// to camelCase format. This is *consistent* with other serialize methods: 7// 8// - $.serialize 9// - $.serializeArray 10// 11// If you require camel casing, you can either download version 1.0.4 or map 12// them yourself. 13// 14 15(function($){ 16 $.fn.serializeObject = function () { 17 "use strict"; 18 19 var result = {}; 20 var extend = function (i, element) { 21 var node = result[element.name]; 22 23 // If node with same name exists already, need to convert it to an array as it 24 // is a multi-value field (i.e., checkboxes) 25 26 if ('undefined' !== typeof node && node !== null) { 27 if ($.isArray(node)) { 28 node.push(element.value); 29 } else { 30 result[element.name] = [node, element.value]; 31 } 32 } else { 33 result[element.name] = element.value; 34 } 35 }; 36 37 $.each(this.serializeArray(), extend); 38 return result; 39 }; 40})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.