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 8216321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:05:18+00:00 2026-06-07T12:05:18+00:00

Okay so I have the following code: function() { $(ul#postbit).load(‘load.php’).fadeIn(slow); }, 3000); What I

  • 0

Okay so I have the following code:

function() { 
$("ul#postbit").load('load.php').fadeIn("slow");
}, 3000);

What I am trying to achieve is after loading load.php to prepend the results in to <li> and have it fade in. At the moment it overwrites what is in ul#postbit. I only want it to load new results and keep what was in there. I hope that makes sense.

  • 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-06-07T12:05:20+00:00Added an answer on June 7, 2026 at 12:05 pm

    The .load() method is designed to work that way, i.e., to load the Ajax response directly into the element(s) that you call it on. Try instead using one of the other Ajax methods, e.g.:

    $.get("load.php", function(data) {
        $(data).prependTo("#postbit").fadeIn("slow");
    });
    

    This assumes your “load.php” returns html including li elements, which is what you seem to be describing when you say your current code overwrites the existing list each time. If your “load.php” returns just the contents for a new li without <li> tags then you can create the li and prepend it:

    $.get("load.php", function(data) {
        $("<li/>").html(data).prependTo("#postbit").fadeIn("slow");
    });
    

    EDIT: To have it continuously reload you could wrap the above into a function that you call with setInterval(), or do something like this:

    function getMoreData() {
        $.get("load.php", function(data) {
            $(data).prependTo("#postbit").fadeIn("slow");
        }).complete(function() {
            setTimeout(getMoreData, 3000);
        });
    }
    getMoreData();
    

    This uses setTimeout() to schedule another run of getMoreData() after 3 seconds, but it does so after the previous request completes.

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

Sidebar

Related Questions

Okay so i have a semi weridish problem with re.sub. Take the following code:
I have the following code at JSfiddle: http://jsfiddle.net/ACG2D/ $(document).ready(function() { $('.testThis').click(function() { $('.regexValidation').each(function() {
Okay, I have a JavaScript file with the following functions: function AskReason() { var
I have the following code: function dbPublish($status) { global $dbcon, $dbtable; if(isset($_GET['itemId'])) { $sqlQuery
My problem is a little bit complex. I have the following code: $(document).ready(function() {
Okay so I have the following Code which appends a string to another in
I have the following: $(#menu, #home).on('click', 'a', function() { // javascript code }); But
Okay I have the following code in Bison .l file. By the way I
Okay, I have the following create action #posts_controller, nested resource under discussions def create
Okay, so i have the following html added to a site using javascript/greasemonkey. (just

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.