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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:02:15+00:00 2026-06-07T08:02:15+00:00

I am using AJAX functionality to make my WordPress pages load in real time.

  • 0

I am using AJAX functionality to make my WordPress pages load in real time. I use the following approach to make it load in real time

var toLoad = $(this).attr('href')+' #container';
$('#container').slideUp('300',loadContent);
$('#load').remove();
$('#wrapper').append('<span id="load">LOADING...</span>');
$('#load').fadeIn('normal');
window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
function loadContent() {
$('#container').load(toLoad,'',showNewContent())
}
function showNewContent() {
$('#container').slideDown('400',hideLoader());
}
function hideLoader() {
$('#load').fadeOut('normal');
}
return false;

The problem i am facing is that the loading… text appear for half a second and the old content appears again.. and then after 4-5 seconds, it just replaces the new content with the old one.
How can i keep the Loading Text until the content is fully loaded.

  • 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-07T08:02:17+00:00Added an answer on June 7, 2026 at 8:02 am

    Question is not perfectly clear to me,

    But,

    $('#container').load(toLoad,'',showNewContent())
    

    should be changed to

    $('#container').load(toLoad,'',showNewContent)
    

    and,

    $('#container').slideDown('400',hideLoader());
    

    to

    $('#container').slideDown('400',hideLoader);
    

    We pass the function reference ( we dont call them )

    Also, I dont think there’s any .fadeIn('normal').

    It would be either .fadeIn('slow') or .fadeIn('fast')

    Also,

    lines following this

    $('#container').slideUp('300',loadContent);
    

    do not wait for animation completion. They gets called instantly.

    I guess, you would want them to put in loadContent function

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

Sidebar

Related Questions

I am working on a filter functionality using ajax/jquery and php/mysql.I have two sets
EDIT: iam using ajax to load text in my content that is why onload
I am playing around with AJAX functionality using ASP.NET MVC. I have created a
I am working with some custom ajax functionality using Telerik's MVC Grid and I
i am using new to prototype and using its ajax functionality but not able
I want to write ajax code in java i.e. i want use the functionality
I'm trying to make some ajax-functionality in my web application, but I cannot get
I am adding jQuery AJAX functionality to my MVC 3 site. When I use
I need to implement ajax upload functionality similar to the one in this page
I'm retro-fitting a .aspx page with AJAX functionality (using VB, not C#). The codebehind

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.