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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:11:00+00:00 2026-05-27T09:11:00+00:00

I want a loading gif image to appear while processing a servlet. What I

  • 0

I want a loading gif image to appear while processing a servlet. What I do is that before processing the form, I call a JSP which contains an animated gif with a loading image. From this JSP, I send a redirect to the servlet which processes the form.
This only works well in Chrome and in Explorer, but in Firefox the image stops moving.

The action of my form is a JSP which contains the loading image and for submiting the form I have the following code:

var form = document.getElementById('reporteEstadisticoAnualArticulo');
var win = window.open("", "reporte","width=1002, height=700,location=0, menubar=0, scrollbars=1, status=1,resizable=0");
form.target = "reporte";
form.submit();

The JSP contains the following code:

    <html>
<head>
    <link type="text/css" href="css/Preloader.css" rel="stylesheet"  />
    <script type="text/javascript">
         function retraso(){
       var vars = getUrlVars();
       var location = document.getElementById("url").value;
           window.location = location+"?"+vars ;
           cargarImagen();
         }
         function cargarImagen() {
            document.getElementById("cargando").src = "images/Cargando.gif";
            return false;
         }
    </script>
</head>
<body onload="setTimeout('retraso()',500)">

    <div align="center" class="Preloader1">

        <label style="font-weight: bold; font-family: arial;">Cargando Reporte</label> <br /><br />
        <img id="cargando" alt="LogoNatura" src="images/Cargando.gif">
        <br /><br />
        <img alt="LogoNatura" src="images/logo.png">
    </div>
    <input type="hidden" value="<%= request.getParameter("url") %>" id="url" />
</body>
</html>

I’ve tried a lot of things to avoid the image to stop moving, but I haven’t found a good answer. If anyone could help, I would be pleased.
This doesn’t work with iframes either. Any ideas?

  • 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-27T09:11:01+00:00Added an answer on May 27, 2026 at 9:11 am

    I already solved my problem. What I did is that I used ajax instead and now my jsp looks as follows:

    <html>
        <head>
            <link type="text/css" href="css/Preloader.css" rel="stylesheet"  />
            <script type="text/javascript" src="js/acciones.js"></script>
        </head>
        <body onload="retraso()">
            <div id ="reporte">
                <div align="center" class="Preloader1" id="loading">
                    <label style="font-weight: bold; font-family: arial;">Cargando Reporte</label> <br /><br />
                    <img id='cargando' alt='LogoNatura' src='images/Cargando.gif'>
                    <br /><br />
                    <img alt="LogoNatura" src="images/logo.png">
                </div>
                <input type="hidden" value="<%= request.getParameter("url") %>" id="url" />
            </div>
        </body>
    </html>
    

    An my javascript file acciones.js contains the following function:

    function retraso(){
        var x = document.getElementById("reporte");
        var content = x.innerHTML;
        var vars = getUrlVars();
        var location = document.getElementById("url").value;
        var url = location+"?"+vars ;
        xmlhttp = GetXmlHttpObject();
        if (!xmlhttp) {
            alert ("Browser does not support HTTP Request");
            return;
        }
        var xml = xmlhttp;
        xmlhttp.onreadystatechange = function () {
            if (xml.readyState == 4) {
                x.innerHTML = xml.responseText;
            } else {
                x.innerHTML = content;
            }     
        };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
    
        return true;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to add that spinning wheel image effect while loading all my images
I want to change JQGrid Loading... message to something with animated gif image. Looked
I want to show a div with a loading animation over my page while
I want a splash screen to show while the application is loading. I have
I'm loading an image from a file, and I want to know how to
I am trying to add a loading image while Ajax is working. I already
I am loading content dynamically using .load() i want to display a loading image
HTML: <div id=lowerLayer> <div id=positionLayer> <div id=imageLayer> <div id=imageHolder style=background-image: url('/Images/Loading/ajax-loader.gif');> </div> </div> </div>
i want that when LightFace will be shown then a busy image should come
I'd like to add a Loading- Image on the top of my ListView while

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.