jq利用ajax异步提交所有表单数据,并且回调
$("button").click(function(){ var data = new FormData($('#biaodan')[0]); //获取表单所有数据 $.ajax({ type: 'POST', data: data, dataType: 'JSON', cache: false, processData: false, contentType: false }).done(function(ret){ //异步回调 if(ret['result'] == '1'){ alert($.trim(ret['info'])); }else{ alert($.trim(ret['info'])); window.history.back(); }); return false; }); |
时间: 2024-09-30 14:11:12