json = {}; // 利用和表单元素相关的特殊选择器 // 理解filter和map的机制 $('#test-form :input').not('button').filter(function(){ //console.log(this.type); return this.type !== 'radio' || this.checked; }).map(function(){ json[this.name] = this.value; return true; }); json = JSON.stringify(json);
Sign in to make a reply
用户6413255914