[eluser]kolxoznik1[/eluser]
My js script
Code:
jQuery(".unblock").click(function(){
var num = jQuery('.page.active').text();
var ban_id = jQuery(this).attr('id');
jQuery.get("http://127.0.0.1/auth_system_1/user_activity/delete_user_ban", { ban_id : ban_id, num : num }, function(data) {
jQuery("#ban_list").append(data);
}, "json");
});
My delete_user_ban function
Code:
function delete_user_ban()
{
$user_id = $this->session->userdata('user_id');
$ban_id = $this->input->post('ban_id');
$current_page = (int)$this->input->post('num');
//$this->activity_model->delete_user_ban($ban_id);
$per_page = 2;
$data['ban_list'] = $this->user_activity_lib->user_ban_list($user_id, $current_page, $per_page);
$this->load->view('front_end/ajax_delete_ban', $data);
}
and I want to return it here
Code:
<!--begin ban list-->
<div id="ban_list">
<?php foreach($ban_list as $value): ?>
<div class="comment-box small-comment" id="info-ban-1">
<div class="photo-box">
<img src="<?=$value['user_image'];?>" alt="" class="photo rounded"/>
<a href="#" title="" class="corner rounded"></a>
</div>
<div class="comment rounded">
<div class="bg-tl"></div>
<div class="avatars">
<a href="#" title=""><?=$value['user'];?></a><span>blocked</span><a href="<?=base_url() . $value['ban_user'];?>" title=""><img src="<?=$value['user_ban_image'];?>" alt=""/><?=$value['ban_user'];?></a>
<a href="[removed];" title="Unblock" class="unblock" id="<?=$value['ban_id'];?>">unblock</a>
</div>
</div>
<div class="both"></div>
</div>
<?php endforeach; ?>
</div>
<!--end ban list-->
<?=$pagination;?>
</div>
What can I say, everything works good EXCEPT data not returned to <div id="ban_list"></div> .
If I delete this line in function :
$this->load->view('front_end/ajax_delete_ban', $data);
and add echo '1';
it return where I want '1' but content from here $this->load->view('front_end/ajax_delete_ban', $data); do not return to this div ? Why ?
I have watched response and html what return and here is html lines returning from view but do not appear in Query("#ban_list").append(data);
Please help me to solve this small problem