Solved

Animated GIF stops animating when page is posted

Posted on 2004-09-13
12
524 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:Malek103197
ID: 12051270
Ok, I'll change my page so I have a frame
0
 

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 50

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

770 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