response.flush() (Method)

Sends the current contents of the output buffer to the client.

Availability:

JavaScript - 1.1
Netscape Enterprise Server - 2.0
JavaScript syntax:NESflush()

Response writing tends to involve a certain amount of buffering by the response manager in the server back-end. This is necessary to improve performance and throughput. The data is only physically transferred to the client when a buffer full of data is ready or when the response is completed. This can mean that a JavaScript error can leave the response incomplete if it fails in a way that prevents the response from being completed properly. A run-time error would normally not write any pending response data out to a client or it might result in part of the data being sent but probably not all.

The flush() method allows you to force the response output to the client to be updated so that the response is complete up to this point and there are no pending contents yet to be transmitted. You might force a flush() at the end of a database record being read and processed for example.

See also:File.flush(), Netscape Enterprise Server