15-3 ?制網?資?????

@ӨAA|N ASP Gsb@ӼȦsϩνwİϡ]Buffer^A浲AANG@ְeΤݡCOApGɶӤ[AiyϥΪ̵ݹL[AƦܥHAwgFAnѨMoӰDA̧֪kANON Response.Buffer ]w falseAɥun檺L{XAN|QߨeΤݡAdҦpUG

Example]response/buffer01.asp^G

WzdҪlɦpUG

lɡ]response/buffer01.asp^G]ǦϰUYi^
<%@language=JScript%>
<%Response.Buffer=false%>
<%title="Response.Bufferd"%>
<!--#include file="../head.inc"-->
<hr>

<%
function delayFunction(n){
	for (var j=0; j<n; j++);	// ɶŰj
}
n=10000000;
%>
ѩ Response.Buffer=falseAHUr|CÇǥX{G
<% delayFunction(n) %><p>]Ĥ@
<% delayFunction(n) %><p>]ĤG
<% delayFunction(n) %><p>]ĤT

<hr>
<!--#include file="../foot.inc"-->

SOn`NOGResponse.Buffer ҥ]tT]OݩYTA]X{beeAHקKyioͪ~C]ioͤ~OHṶ̷̄QQC^

UoӽdҡAϥ BufferBFlushBClearBEnd kӱAwİϸƪǰeG

Example]response/buffer02.asp^G

WzdҪlɦpUG

lɡ]response/buffer02.asp^G]ǦϰUYi^
<%@language=JScript%>
<%Response.Buffer=true%>
<%title="Response.BufferBFlushBClearBEnd d"%>
<!--#include file="../head.inc"-->
<hr>

ڧwİϪeߨeȤݡAҥHoOAݱo쪺eC
<br><!--#include file="../foot.inc"-->
<%Response.Flush;%>

<p>ڧwİϪeMFAҥHoOAݤ쪺eC
<%Response.Clear;%>

<p>ڤS}lgJwİϡAҥHoOAݱo쪺eC

<%Response.End;%>
<p>odzݤA]Aݨ Response.EndANAǰeƤFI

bWzdҤAڭ̧A^ǪƩmwİϡ]Buffer^AçQΤPkӱwİϪơC

Hint
  • аȥAѤWzdҤAǸƷ|Ǧ^ΤݡBǸƤ|Ǧ^ΤݡC
  • YNWҪ Response.Buffer אּ falseAаݷ|oͤ򵲪GHиլݬݡI


JScript {]pPΡGΩAݪ ASP