• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 548
  • Last Modified:

Animated GIF stops animating when page is posted

I have page1.asp that has an animated GIF inside a div -

<div id="pleaseWait"><img border="0" src="graphics/making_your_map.gif"></div>

Near the bottom of my page I have -

<script language="javascript">
   document.getElementById("pleaseWait").style.visibility = "hidden";

I have a javascrpt function  -


 document.getElementById("pleaseWait").style.visibility= "visible";

However, as soon as the page is posted to "processGPS.asp", the animiated GIF stops animating..I want it to keep animating to let the user know to wait while the server is processing.

How do I get it to keep animating?
1 Solution
You'll have to put the animating code once more in processGPS.asp. Can you post your code?
Malek103197Author Commented:
Here's my processGPS.asp =

'Option explicit
Response.Buffer = TRUE
Response.Expires = 0
Response.ExpiresAbsolute = Now - 1

<title>Process the Form</title>
<body bgcolor = "white">

      tripDate = Request.Form("selDate")
      tripTruck = Request.Form("truckName")
      dllText = tripDate & "+" & tripTruck
      Set objMap = Server.CreateObject ("traceLayer.createTraceLayer")
        bReturn = objMap.CreateGPSLayer(dllText)
        set objMap =nothing
      Response.Redirect("TripReport1.asp?retDLL=" & dllText)



I would suggest using a frameset. Have the top frameset have the loading animation. Then, in the bottom frameset, have some Javascript that will "turn off" the top frameset by hiding it. This is because since ASP is server-side, you should have the frameset display the image while it's processing.
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Malek103197Author Commented:
Ok, I'll change my page so I have a frame
Malek103197Author Commented:
can I embed a frameset within a cell of a table?
Not with an iframe. You need a separate frame, because the iframe will be loaded with the HTML on the page, so the animation will display AFTER the ASP is done processing. If you use a frame, the frameset page will load and both will be loaded at the same time, so while the ASP is processing, you top frame, for instance, can have the image showing.
Ryan ChongCommented:
I think the problem is on how you call the function of PostMap(), didn't you called it from a hyperlink (<a>) ? if yes, make sure you put a "return false" there in the onclick event..
you can check if page was completely loaded by...

var tmr;
function onLoad_(){
    if(document.body.readyState.toLowerCase() == "complete"){
         document.getElementById("pleaseWait").style.visibility = "hidden";
<body onload="onLoad_()">
Malek103197Author Commented:
Sorry folks, I got distracted for a bit on this one..Let me try some of this stuff and get back toy ou soon.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now