ajax编码有关问题,大侠帮忙!

WBOY
Lepaskan: 2016-06-13 12:37:18
asal
971 orang telah melayarinya

ajax编码问题,在线等大侠帮忙!!!

	public function ajax_page(){<br />
		//header('Content-Type:text/html;charset=gbk');<br />
		error_reporting(E_ALL);<br />
		$page = $this->input->post('pg');<br />
		$where = $this->input->post('action');<br />
		$array = explode('_',$where);<br />
		$condition['group_id'] = $array[0];<br />
		$condition['status'] = $array[1];<br />
		$condition['username'] = @iconv( "UTF-8","GBK", $array[2]);<br />
echo $condition['username'];<br />
		$condition['display'] = 15;<br />
		$condition['page'] = ($page-1) * 15;<br />
		$num = $this->member_model->Selcount($condition);<br />
        $url = base_url()."/index.php/admin/member_list/";<br />
		$this->page->select = $where;<br />
        $this->page_model->page($num,"15",$page,$url);<br />
        $data['page'] = $this->page->pagenav;<br />
		$data['user'] = $this->member_model->Selmember($condition);<br />
        $this->load->language('admin/member');<br />
        $data['lang'] = $this->lang->line('HtmlLanguages');<br />
  	 	//print_r($data['user']);//exit;<br />
<br />
   		$this->load->view('admin/member_list_ajax', $data);<br />
<br />
	}
Salin selepas log masuk



<script type="text/javascript"> <br />
$(function(){<br />
    $('#begin_date').datepicker({dateFormat: 'yy-mm-dd'});<br />
    $('#end_date').datepicker({dateFormat: 'yy-mm-dd'});<br />
});<br />
function checkdata(){<br />
	if((!$('#begin_date').val()&&$('#end_date').val())||($('#begin_date').val()&&!$('#end_date').val())){<br />
		alert('<?=$lang['date_error']?>');<br />
		return false;<br />
	}<br />
}<br />
function php300(page,where){<br />
	var ajax_url = "/admin/ajax_page/";<br />
    where = encodeURIComponent(where);<br />
	$.ajax({<br />
		type: "POST",<br />
		url: ajax_url,<br />
		data:{ <br />
			action: where,<br />
			pg: page<br />
		},<br />
		success: function(msg){<br />
			//alert(msg);<br />
			$("#ajax").html(msg);<br />
		},//$("#pager").html(msg);<br />
		error:function(){ <br />
			$("#ajax").html("请求失败"); <br />
		}<br />
    });<br />
   <br />
}<br />
</script>
Salin selepas log masuk

Label berkaitan:
sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan
Tentang kita Penafian Sitemap
Laman web PHP Cina:Latihan PHP dalam talian kebajikan awam,Bantu pelajar PHP berkembang dengan cepat!