jQuery(document).ready(function(){
jQuery('.submit').click(function(){
jQuery.ajax({
type:'post',
dataType:'json',
data:jQuery('#form').serialize(),
url:"{lanrain::U('XhCustomForm/index',array('token' => $_GET['token'],'wecha_id' => $_GET['wecha_id'],'f_id' => $_GET['f_id']))}",
success:function(data){
if(data == 1){
alert('提交成功');
}else{
alert('提交失败');
}
}
});
})
})
</script>
jQuery('#form').serialize() 提交整个form表单的数据
原文链接:https://www.f2er.com/ajax/164011.html