标签:io ar os sp on cti bs ad nbsp
<script>
$(document).ready(function(){
$("#sub").click(function(){
var data = "";
$("input").each(function(){
var name=this.name;
data+=name+‘:‘+‘"‘+$(this).val()+‘"‘+‘,‘;
});
data=data.substring(0,data.length-1);
data="{"+data+"}";
var info=eval(‘(‘+data+‘)‘);
$.post("{url(‘index/addcar‘)}",info,function(msg,status){
alert(msg);
}
);
});
});
</script>
获取所有input值 处理成json格式再利用$.post提交
标签:io ar os sp on cti bs ad nbsp
原文地址:http://www.cnblogs.com/i6010/p/4120613.html