Solved

Animated GIF stops animating when page is posted

Posted on 2004-09-13
12
522 Views
Last Modified: 2013-11-19
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";
<script>

I have a javascrpt function  -

PostMap(){

 document.getElementById("pleaseWait").style.visibility= "visible";
 document.demo.action="processGPS.asp";
 document.demo.method="post";
 document.demo.submit();
}

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?
0
Comment
Question by:Malek103197
12 Comments
 
LVL 36

Expert Comment

by:Zyloch
ID: 12051207
You'll have to put the animating code once more in processGPS.asp. Can you post your code?
0
 

Author Comment

by:Malek103197
ID: 12051234
Here's my processGPS.asp =

<%@Language=VBScript%>
<%
'Option explicit
Response.Buffer = TRUE
Response.Expires = 0
Response.ExpiresAbsolute = Now - 1
%>

<html>
<head>
<title>Process the Form</title>
</head>
<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)

'======================================================

%>

</body>
</html>
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12051255
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.
0
 

Author Comment

by:Malek103197
ID: 12051270
Ok, I'll change my page so I have a frame
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Malek103197
ID: 12051283
can I embed a frameset within a cell of a table?
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12051287
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.
0
 
LVL 49

Accepted Solution

by:
Ryan Chong earned 250 total points
ID: 12052711
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..
0
 
LVL 13

Expert Comment

by:davidlars99
ID: 12071218
you can check if page was completely loaded by...

var tmr;
function onLoad_(){
    clearTimeout(tmr)
    if(document.body.readyState.toLowerCase() == "complete"){
         document.getElementById("pleaseWait").style.visibility = "hidden";
         return
     }
     tmr=setTimeout('onLoad_()',50)
}
   
<body onload="onLoad_()">
0
 

Author Comment

by:Malek103197
ID: 12112272
Sorry folks, I got distracted for a bit on this one..Let me try some of this stuff and get back toy ou soon.
Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now