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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:52:46+00:00 2026-06-03T20:52:46+00:00

I am making an ajax call with the following script: window.onload = function() {

  • 0

I am making an ajax call with the following script:

window.onload = function() {
    if (!session) {
        layoutType = document.documentElement.clientWidth;
        var xmlhttp;
        if (window.XMLHttpRequest)
          xmlhttp=new XMLHttpRequest();
          }
        else
          xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
          }
        xmlhttp.onreadystatechange=function()
          {
        if (xmlhttp.readyState==4 && xmlhttp.status==200)
            {
            window.location.reload();
            }
        }
        xmlhttp.open("POST","core/session.php?bW=" + bW,true);
        xmlhttp.send();
    }
}

I want to insert a loading image and some text while the pahe loads. How ca I do that?

I want to insert the following image link and text:

<img src="cdn/images/ajax-loader.gif" />
<h3>Please wait while we load</h3>

Please help.

  • 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-03T20:52:47+00:00Added an answer on June 3, 2026 at 8:52 pm

    you can add an image to the loading are when ajax loads it will basically overwrite your image
    the ajax loader

    <script>
       var DisplayIMge = document.getElementById("ajaxdiv");
        DisplayIMge.innerHTML = "<img src='cdn/images/ajax-loader.gif' /><h3>Please wait while we load</h3>"
    </script>
    

    for instance here is the ajax based on the one you are using

    <html>
    <head>
    <script type="text/javascript">
    function showHint(str)
    {
    if (str.length==0)
      { 
      document.getElementById("txtHint").innerHTML="";
      return;
      }
    if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
      }
    else
      {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp.onreadystatechange=function()
      {
      if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
        document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
        }
      }
    xmlhttp.open("POST","core/session.php?bW=" + bW,,true);
    xmlhttp.send();
    }
    </script>
    </head>
    <body>
    
    <p><b>Start typing a name in the input field below:</b></p>
    <form> 
    First name: <input type="text" onkeyup="showHint(this.value)" size="20" />
    </form>
    <p><div id="ajaxdiv"><div></p>
    
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making ajax call like this $(document).ready(function() { var abc = new Array();
I'm making an ajax call to a rest API and specified the following header
I am making an ajax call with jquery like: $.ajax({ url: path/to/webservice.asmx beforeSend: function(xmlHTTPRequest)
I am making the following ajax call: $.ajax({ type: type, url: url, data: data,
I'm making a ajax call using jQuery I'm making use of the following options
I'm using the following ajax function: function callAjax(request,callback) { if (window.XMLHttpRequest) {// code for
I have this function in charge of making a ajax call, and based on
i'm making an ajax call to a php function... i'm trying to display the
I am making an AJAX call and I get the following: {status:Results Found,errorcode:0,result:[{name:test,id:1},{name:some,id:2}]} What
I am making an ajax call using the following code. $.ajax( { url: '/BuildingCompany/EditAjax/'

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.