Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7430803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:11:52+00:00 2026-05-29T09:11:52+00:00

My js script 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, {

  • 0

My js script

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

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

<!--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 .

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 (no errors) but do not appear in JQuery(”#ban_list”).append(data);

My .get works good but only return one word, also looking response and html in firebug it show returned lines but do not add it to div?

I have made some test :

echo '1111';

return OK!

echo '1111 2222';

do not return ?

How to return more then one word and where is my mistake ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:11:53+00:00Added an answer on May 29, 2026 at 9:11 am

    You’re mixing get’s and post’s, no?

    Either change your jQuery to $.post()

    Or change your PHP to $this->input->get();

    You’re also using ‘json’ in your $.get() call, but returning HTML.

    You should json_encode your view.

    You can hand a boolean third parameter to $this->load->view() that will return the HTML in the view to a string.

    $myHTML = $this->load->view('front_end/ajax_delete_ban', $data, true);
    echo json_encode(array("html" => $myHTML));
    

    Then, in your jQuery callback function, you can retreive the html using data.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello guys on my blog I use this script: jQuery(document).ready(function () { jQuery(.postbox).hover(function ()
I have a jQuery script: $.ajax({ url: /scripts/secure/development/ajax.asp, type: POST, dataType: text, data: cmd=addresses,
I have this jquery script which suppose to hide/show div element base on the
how can I make this jquery script close all previously opened children when entering
I've got some trouble with jQuery script on my Asp.net page. During first load
I'm currently working on a jQuery script that will translate the site's text into
I'm attempting to select all <script type=text/html> tags in a page. I use <script>
I already have the following for the JS files: <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js></script> <script type=text/javascript>!window.jQuery
<html> <head> <title></title> <script src=script/jquery-1.6.1.min.js type=text/javascript></script> <script src=script/jquery.autocomplete.js type=text/javascript></script> <script src=script/jquery-ui-1.8.13.custom.min.js type=text/javascript></script> <script type=text/javascript>
I need a jquery script section that checks to see if the first digit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.