Display text before ending the script

A

andre.labonte

Hi!

I have a script that is taking some time to run and in my page, i've
placed some comments to be displayed on the webpage so I can know what
the script is currently running.
Unfortunately, the HTML page is displayed ONLY when the script is
entirely finished.
I'd like the comments placed within the script to be displayed as soon
as the script is reading them, not at the end!

(I don't know if i'm clear enough, here's an example)

CURRENTLY:

(script running)
....
(script end)
HTML page will show:
The script is starting...
Script step 1...
Script step 2...
Done!


WHAT I'D LIKE IT TO DO:

(script running)
The script is starting...
(script continues)
Script step 1...
(script continues)
Script step 2...
(script end)
Done!

Thanks!
Andrew
 
B

Bob Barrows [MVP]

Hi!

I have a script that is taking some time to run and in my page, i've
placed some comments to be displayed on the webpage so I can know what
the script is currently running.
Unfortunately, the HTML page is displayed ONLY when the script is
entirely finished.
I'd like the comments placed within the script to be displayed as soon
as the script is reading them, not at the end!

You need to turn the response buffer on and, when you want the output
sent to the client, flush the buffer

Response.Buffer = True
....
Response.Flush
....
Response.Flush
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top