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

  • Home
  • SEARCH
  • 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 6725859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:51:26+00:00 2026-05-26T09:51:26+00:00

Hello I am having trouble regarding div reloading when a new record has been

  • 0

Hello I am having trouble regarding div reloading when a new record has been added. What I wanted to do is to show first a loading image then after a record has been inserted it will reload the div.

$("a.follow").click(function(event) {
    event.preventDefault();
    $("#flash").show();
    $("#flash").fadeIn(300).html('<img src="ajax-loader-transp.gif" />Loading Result.');

    $.ajax({
        //url: $(this).attr("href"),
        success: function(msg) {
            $("#results_div").load('http://localhost/<app_name>/index.php/<contoller>/index');
        }
    });
    return false;
});

That’s what I got to far when I’m trying the code it refreshes a whole physical of page on the div & not the desired div itself. . .

Sorry guys I am poor with jQuery and BTW this is in CodeIgniter.

  • 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-26T09:51:27+00:00Added an answer on May 26, 2026 at 9:51 am

    Your problem is, that codeigniter obviously returns a whole html page. You have two choices:

    Either return only a fragment (I don’t know how to do this in CI) or use jQuery to parse out the div you want. This can be done with the following code, assuming that the div you want is named <div id="results_div">...</div>

    $("a.follow").click(function(event) {
        event.preventDefault();
        $("#flash").show();
        $("#flash").fadeIn(300).html('<img src="ajax-loader-transp.gif" />Loading Result.');
        $("#results_div").load('http://localhost/<app_name>/index.php/<contoller>/index #results_div', function(){ $('#flash').hide(); });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I have been having trouble with this for a while now. I have
Getting started with jquery and having trouble getting hello world type example going for
Hello I am having trouble using multiquery in facebook .net. I am trying to
this is a rather basic question (I'm new to Django) but I'm having trouble
Hello good people of Stack Overflow, I am having trouble with an application I
Hello I'm having trouble figuring this out. I have these structs and classes. struct
I am having trouble with the Hello Map Views tutorial from the Android Developer
I have been having trouble while attempting to use the nextLine() method from java.util.Scanner.
Hello trying to get my website to display correctly having trouble. I am using
I'm fairly new to Cocoa and am having trouble Googling for the best way

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.