Every line of 'serialize jquery' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
47 function serializeObject(obj) { 48 var o = {}; 49 var a = obj.serializeArray(); 50 $.each(a, function() { 51 if (o[obj.name]) { 52 if (!o[obj.name].push) { 53 o[obj.name] = [o[obj.name]]; 54 } 55 o[obj.name].push(obj.value || ''); 56 } else { 57 o[obj.name] = obj.value || ''; 58 } 59 }); 60 return o; 61 }