<bdo id='sjKMB'></bdo><ul id='sjKMB'></ul>
    <legend id='sjKMB'><style id='sjKMB'><dir id='sjKMB'><q id='sjKMB'></q></dir></style></legend>

      <i id='sjKMB'><tr id='sjKMB'><dt id='sjKMB'><q id='sjKMB'><span id='sjKMB'><b id='sjKMB'><form id='sjKMB'><ins id='sjKMB'></ins><ul id='sjKMB'></ul><sub id='sjKMB'></sub></form><legend id='sjKMB'></legend><bdo id='sjKMB'><pre id='sjKMB'><center id='sjKMB'></center></pre></bdo></b><th id='sjKMB'></th></span></q></dt></tr></i><div id='sjKMB'><tfoot id='sjKMB'></tfoot><dl id='sjKMB'><fieldset id='sjKMB'></fieldset></dl></div>
    1. <small id='sjKMB'></small><noframes id='sjKMB'>

      <tfoot id='sjKMB'></tfoot>

      如何在很长一段时间内逐步向浏览器显示 HTML?

      How to display HTML to the browser incrementally over a long period of time?(如何在很长一段时间内逐步向浏览器显示 HTML?)
        <tbody id='pQtfr'></tbody>
      <i id='pQtfr'><tr id='pQtfr'><dt id='pQtfr'><q id='pQtfr'><span id='pQtfr'><b id='pQtfr'><form id='pQtfr'><ins id='pQtfr'></ins><ul id='pQtfr'></ul><sub id='pQtfr'></sub></form><legend id='pQtfr'></legend><bdo id='pQtfr'><pre id='pQtfr'><center id='pQtfr'></center></pre></bdo></b><th id='pQtfr'></th></span></q></dt></tr></i><div id='pQtfr'><tfoot id='pQtfr'></tfoot><dl id='pQtfr'><fieldset id='pQtfr'></fieldset></dl></div>
      <tfoot id='pQtfr'></tfoot>
      <legend id='pQtfr'><style id='pQtfr'><dir id='pQtfr'><q id='pQtfr'></q></dir></style></legend>
        • <bdo id='pQtfr'></bdo><ul id='pQtfr'></ul>

              • <small id='pQtfr'></small><noframes id='pQtfr'>

                本文介绍了如何在很长一段时间内逐步向浏览器显示 HTML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我是否需要传回任何 HTTP 标头以告诉浏览器我的服务器不会立即关闭连接并在收到 HTML 时显示?是否有必要让 HTML 像 flush() 那样增量显示?

                Do I need to pass back any HTTP headers to tell the browser that my server won't be immediately closing the connection and to display as the HTML is received? Is there anything necessary to get the HTML to incrementally display like flush()?

                这种技术曾经用于聊天之类的事情,但我正在考虑将其用于 COMET 类型的应用程序.

                This technique used to be used for things like chat, but I'm thinking about using it for a COMET type application.

                推荐答案

                长轮询是一种常见的技术来做这样的事情;简单总结一下,它的工作原理如下:

                Long polling is a common technique to do something like this; to briefly summarise, it works as follows:

                1. 客户端向服务器发送 XHR.

                1. The client sends an XHR to the server.

                • 如果有数据准备好,服务器会立即返回.
                • 如果没有,服务器保持连接打开,直到数据可用,然后返回.
                • 如果请求超时,请返回 1).

                客户端上运行的页面接收到这些数据,并对其进行处理.

                The page running on the client receives this data, and does what it does with it.

                这就是 Facebook 实现其聊天功能的方式.

                This is how Facebook implements its chat feature.

                这篇文章也澄清了一些误解长轮询,并详细说明了这样做的一些好处.

                This article also clears up some of the misconceptions of long-polling, and details some of the benefits of doing so.

                这篇关于如何在很长一段时间内逐步向浏览器显示 HTML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                <tfoot id='FvVxZ'></tfoot>

                    • <legend id='FvVxZ'><style id='FvVxZ'><dir id='FvVxZ'><q id='FvVxZ'></q></dir></style></legend>

                      <small id='FvVxZ'></small><noframes id='FvVxZ'>

                      <i id='FvVxZ'><tr id='FvVxZ'><dt id='FvVxZ'><q id='FvVxZ'><span id='FvVxZ'><b id='FvVxZ'><form id='FvVxZ'><ins id='FvVxZ'></ins><ul id='FvVxZ'></ul><sub id='FvVxZ'></sub></form><legend id='FvVxZ'></legend><bdo id='FvVxZ'><pre id='FvVxZ'><center id='FvVxZ'></center></pre></bdo></b><th id='FvVxZ'></th></span></q></dt></tr></i><div id='FvVxZ'><tfoot id='FvVxZ'></tfoot><dl id='FvVxZ'><fieldset id='FvVxZ'></fieldset></dl></div>

                        • <bdo id='FvVxZ'></bdo><ul id='FvVxZ'></ul>
                            <tbody id='FvVxZ'></tbody>