0

页面加载后如何运行asp代码?我试图让页面加载更快,然后在 ajax 加载页面中显示内容。我正在为页面制作动画,并且在加载 asp 代码之前动画没有开始,所以这就是为什么我想先加载页面然后运行 ​​asp 代码。任何输入表示赞赏。谢谢

4

1 回答 1

1

您可以Response.Flush在发送 HTML 头部部分后添加一个。这将使浏览器有时间在服务器忙于生成输出时加载样式表/脚本。

确保在调用后延迟内容生成Response.Flush以完成此操作。

伪代码:

Response.Write "<DOCTYPE html>"
Response.Write "<html><head>....</head><body>"
Response.Flush ' output so far is sent to the client

' load data from database
dim s_content
s_content = buildPageContent()
Response.Write s_content

Response.Write "</body></html>"
于 2013-06-07T09:37:40.523 回答