Solved

Animated GIF stops animating when page is posted

Posted on 2004-09-13
12
519 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
Comment Utility
You'll have to put the animating code once more in processGPS.asp. Can you post your code?
0
 

Author Comment

by:Malek103197
Comment Utility
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
Comment Utility
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
Comment Utility
Ok, I'll change my page so I have a frame
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

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

Expert Comment

by:Zyloch
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

762 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

12 Experts available now in Live!

Get 1:1 Help Now