Discuss / JavaScript / 学习了

学习了

Topic source

json={}; $('#test-form :input[type!=submit]').map(function(){json[this.name]=this.value}); json = JSON.stringify(json);

json={};
$('#test-form :input[type!=submit]').map(function(){json[this.name]=this.value});
json = JSON.stringify(json);

这样做貌似gender永远是f,有问题。对type=radio的貌似得特殊处理


  • 1

Reply