Server-side function | |
Implemented in | LiveWire 1.0 |
flush()
flush
function immediately sends data from the internal buffer to the client. If you do not explicitly call the flush
function, JavaScript sends data to the client after each 64KB of content in the constructed HTML page.
Use the flush
function to control when data is sent to the client. For example, call the flush
function before an operation that creates a delay, such as a database query. If a database query retrieves a large number of rows, you can flush the buffer after retrieving a small number of rows to prevent long delays in displaying data.
flush
function updates the client's cookie file as part of the HTTP
header, you should perform any changes to the client
object before flushing
the buffer, if you are using client cookie to maintain the client
object. For
more information, see Writing Server-Side JavaScript Applications.
Do not confuse the flush
method of the File
object with the top-level flush
function. The flush
function is a top-level server-side JavaScript function that is not associated with any object.flush
function then causes the client to display the output.while (!In.eof()) {
AscLine = In.readln();
if (!In.eof())
write(LPad(LineCount + ": ", 5), AscLine, "\n");
LineCount++;
flush();
}
write
Last Updated: 10/31/97 16:38:00