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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:44:57+00:00 2026-05-13T06:44:57+00:00

Still learning this jQuery stuff…. I like this ajax page loader; it works for

  • 0

Still learning this jQuery stuff….

I like this ajax page loader; it works for WordPress on a <div id="content"> right out of the box. But one thing bothers me: the collapses while ajax loads the page and spins the spinner, and I’d like to be able to have the div retain some of it’s size instead of making the footer of the page jump up and then down. The doesn’t have to be taller than 500-600 px, just so it doesn’t bounce the footer up and down. Is that possible with this function in the way it’s written? Below are the most relevant functions. (Others I’ve left out have to to with WordPress and its URL structure.)

function loadPage(url){
  if(!isWorking){
    scroll(0,0);
    document.getElementById('content').innerHTML='<center><img src="'+loadingIMG.src+'" /></center>';
    http.open('GET',url,true);
    isWorking=true;
    http.onreadystatechange=showPage;
    http.send(null);
  }
}

function showPage(){
  if(http.readyState==4){
    if(http.status==200){
      isWorking=false;
      var content = http.responseText;
      content = content.split('id="content"')[1];
      content = content.substring(content.indexOf('>')+1);
      var depth=1;
      var output='';
      while(depth>0){
        temp = content.split('</div>')[0];
        //count occurrences
        i=0;
        pos = temp.indexOf("<div");
        while(pos!=-1){
          i++;
          pos = temp.indexOf("<div",pos+1);
        }
        //end count
        depth=depth+i-1;
        output=output+content.split('</div>')[0]+'</div>';
        content = content.substring(content.indexOf('</div>')+6);
      }
      document.getElementById('content').innerHTML=output;
      pageLoaderInit();
    }else{
      alert(http.status);
    }
  }
}
  • 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-13T06:44:57+00:00Added an answer on May 13, 2026 at 6:44 am

    I don’t actually see any jquery there, but you should be able to use plain old javascript to set the height of the content div.

    In loadPage:

    var contentDiv = document.getElementById('content');
    contentDiv.innerHTML='<center><img src="'+loadingIMG.src+'" /></center>';
    contentDiv.style.height = "600px";
    

    In showPage:

    var contentDiv = document.getElementById('content');
    contentDiv.innerHTML=output;
    contentDiv.style.height = "";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 291k
  • Answers 292k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Did you try overriding (BOOL)canPerformAction:(SEL)action withSender:(id)sender of UIResponder? That controls… May 13, 2026 at 6:07 pm
  • Editorial Team
    Editorial Team added an answer We have used CAutomationElement class for seaching the elements on… May 13, 2026 at 6:07 pm
  • Editorial Team
    Editorial Team added an answer from collections import defaultdict def leaders(xs, top=10): counts = defaultdict(int)… May 13, 2026 at 6:07 pm

Related Questions

I would like to learn how to do fade, and similar effects on JavaScript.
Sorry for all the dumb jquery questions I'm still learning and find this to
I'm a jquery newbie... still learning the framework.... and here goes my query... The
I am new to javascript and still learning the ropes. I am trying to
Ok I am still having some issues with this code below. I have received

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.