<!-- 表单ajax提交方法 -->
<script type='text/javascript'>
jQuery(document).ready(function(){
jQuery('form').submit(function(){
jQuery.ajax({
type:'post',
dataType:'json',
data:jQuery('#activityform').serialize(),
url:'/admin/activity/edit?aid='+{{$activity->aid}},
success:function(data){
if(data == 1){
alert('success');
}else{
alert('failure');
}
location.href = '/admin/activity/manage';
}
})
})
})
</script>
原文链接:https://www.f2er.com/ajax/163720.html