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 |
Prev | Home | Next |
response.deleteResponseHeader() | Up | response.getOptionValue() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |