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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:49:02+00:00 2026-06-10T10:49:02+00:00

can anyone tell me how to display a loading gif image when the page

  • 0

can anyone tell me how to display a loading gif image when the page to be reloaded takes a little bit time?

i’m using jquery-ajax for loading pages.
An example of my jquery-ajax for loading pages is shown below.

loader.js

$(document).ready(function(){  
 $("#emphome").click(function(){  
 $("#response").load("EMP_Home.jsp");  
 });  
 $("#custhome").click(function(){  
 $("#response").load("Customer_Home.jsp");  
 });  
 $("#manahome").click(function(){  
 $("#response").load("Manager_Home.jsp");   
 });  
}); 

test.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <head>

    <script type="text/javascript" src="js/jquery.js"></script> </head> <body>

        <!--==============================content================================-->
       <div class="container" id="response">
            </div>
        <a href="#Customer Home"  id="custhome" class="nav">Customer Home</a>
        <a href="#Employee Home"  id="emphome" class="nav">Employee Home</a>
        <a href="#Manager Home"  id="manahome" class="nav">Manager Home</a>     <!--==============================footer=================================-->
         <script type="text/javascript" src="js/loader.js" ></script>

<!--  End top Nav-->

</body> </html>

Customer_Home.jsp

<%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1>Welcome to Customer Home!</h1>
    </body> </html>

EMP_Home.jsp

<%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1>Welcome to Customer Home!</h1>
    </body> </html>

Manager_Home.jsp

<%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1>Welcome to Manager Home!</h1>
    </body> </html>

The above code works fine. since the pages to be loaded is simple. but when it comes to complex pages it takes a bit time to load! can anyone tell me how to display a loading image for the loading time?

  • 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-10T10:49:03+00:00Added an answer on June 10, 2026 at 10:49 am
    $(document).ready(function () {
        $("your_loafing_gif_image_id").hide();
    
        $("#emphome").click(function () {
            $("your_loafing_gif_image_id").show();
            $("#response").load("EMP_Home.jsp", function(){
                $("your_loafing_gif_image_id").hide();
            });
        });
    
        $("#custhome").click(function () {
            $("your_loafing_gif_image_id").show();
            $("#response").load("Customer_Home.jsp", function(){
                $("your_loafing_gif_image_id").hide();
            });
        });
    
        $("#manahome").click(function () {
            $("your_loafing_gif_image_id").show();
            $("#response").load("Manager_Home.jsp", function(){
                $("your_loafing_gif_image_id").hide();
            });
        });
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am new to jquery, can anyone tell me how to display and image
Can anyone tell me the easiest way to display a jQuery dialogafter a postback
recently got an issue when loading vs 2008, it displays this... can anyone tell
Can anyone tell me how to display the other values, when a query is
Can anyone tell me what the difference is between: Display *disp = new Display();
CAn anyone tell me is it is possible to display the files in computer
Can anyone tell me how to get and display the biggest values from a
can anyone tell me how to select data by date in MS.ACCESS database using
Hi can anyone tell me how I can get a JavaScript alert to display
Can anyone tell me how I can display a status message like 12 seconds

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.