Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

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

displaying waiting page

I have a webpage that get the data from database and it takes quite awhile to do this and i want to display it as soon as it done...
the problem is before i display the data I want the user to see the another page with a .gif animation on it and it said "please wait, processing your order."
how do I do this ? i did java script "onLoad" and redirected to the result on the waiting page but the gif image doesn't animate.

here is the waiting page

     <script type="text/javascript">
          function loadit(){
               window.location = 'result.asp?sOrder=10';
     <title>processing order</title>
     <body onLoad="loadit()">
          <h1 class="PageHeads">processing <img src="../progress_ani.gif" border="0"></h1>

1 Solution
Your onLoad is being executed right away.  You actually want to do something like this:

// this will set the reload timer


working blah blah blah

The problem with this is it is not preloading the second page while the timeout happens - which I think is what you believe is happening.  In fact, the query won't get run till results get run (unless somehow your pre-running it and maybe moving the results into a smaller table that you pull on results.asp)

The way I'd do this?  I'd have the page display the animated gif in a layer... flush that to the browser (response.flush), then have it run the query... push results to a hidden layer.. when that is all done hide the processing layer and show the hidden layer..  

If this solution is something you'd be interested in doing, let me know and I'll give more details.

Good luck,
Chris Caputo
I would have to agree with Chris on this one.
Use this

'Main File
<Form Action="Progress.Asp" Method="POST">
Name : <Input Type=Text Name="txtName"><Br><Br>
<Input Type=Submit>

<Body OnLoad="Javascript:document.location='Query.Asp';">
<Img Src="yourgif.gif">

  Dim con,rst
  Set con=Server.createObject("ADODB.Connection")
  Set rst=Server.CreateObject("ADODB.REcordSet")

  con.OPen  'Place open code here
  rst.Open "Select * from Table Where Name='" & Session("txtName") & "'"

  'Do the rest here

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

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