CI学习AJAX提交表单,审核
ajax
php
$data=array(
$data['success']=1,
);
$this->output->set_output(json_encode($data));
$this->output->_display();
eixt;
html
function saveform(){ $ajax({ type:'post', url:'<?php echo $now_url;?>',//这里是地址 datatype:'json', async:false, data:$('#form1').serialize(), success:function(data){ if (data==1){ alert('success'); window.location.href="跳转url"; }else{ alert('err'); } } }); }