Date:  10/14/2004 02:11:16 PM Msg ID:  002269
From:  Joe Bigelow Thread:  002266
Subject:  Re: thermometer
Tim & FWSupport,
 
Thanks, but I guess I wasn't clear in my question. I've already got the animated gif I need to display. That isn't the problem.
 
The problem I'm having is figuring out the correct sequence to display the graphic while the script is processing and then replacing it with the results of the processing.
 
Indeed, this is a shopping cart system. There is a rather complex form, (potentially) containing a whole bunch of stuff like the items being ordered, credit card info, shipping info etc. AND a submit button.
 
What I need to happen is that when they press the submit button, the script puts up a page with the processing graphic appears and then the script process stuff. It can take a little time, first because it's processing the credit card, twice (don't ask..., its preauthorizing to confirm legitimacy of the card and then postauthorizing to get the cash), but it is doing a whole lot more stuff as well. So I don't want to leave the viewer just hanging out there for the up to 30 seconds this can take, which is why I want the graphic pulsing away.
 
Once the credit card is processed and the script is finished saving and emailing I need to change the browser page for the viewer putting up  the receipt and confirmation, etc.
 
From what I can tell, I need to send two separate pages to the browser, but I cannot figure out how. I've tried Response.Flush, Response.Clear and Response.End, the latter being obviously fatal to the script. What happens with Response.Celar is I successfully get the processing graphic up immediately, but when the recepit page is sent it is "appended" to the bottom of the page with the graphic, it is not a new page. The same thing happens without Response.Clear, except the page doesn't appear until the script is done. If I turn buffering off and use the second technique without the Response.Clear, the graphic comes up fast, and then the second presentation is appended beneath.
 
I've tried putting the creation of the page containing the processing graphic into a completely separate program called by the script so that, as described in the FoxWeb documentation, a Response.End will not kill the higher level script, but it does kill it.
 
I guess I could turn off buffering and use the js you just referred me to, but if I do that, then the bar will be left hanging out on the page, and I'd rather present a "clean" receipt.
 
Is this a better explaination?
 
Thanks
 
JoeB
 
 
 
 
Sent by FoxWeb Support on 10/14/2004 01:47:04 PM:
You can do this by sending Javascript code to the browser while your request is being processed.  The file http://www.foxweb.com/files/ProgressBar.zip contains some sample code, illustrating this technique.

FoxWeb Support Team
support@foxweb.com email

Sent by Joe Bigelow on 10/14/2004 12:34:34 PM:
I'm creating a new set of programming and I need, at one point during some processing, to stick up a thermometer or some other graphic to the viewers browser while the programming processing something, then finally sends the resulting HTML page. I can't seem to get the right sequence of stuff in the right order to get this to work. Do you have a sample program or something that would illustrate the correct technique?
 
Thanks!
 
Joe Bigelow
HV/Net