<tfoot id='3vyrQ'></tfoot>
    <bdo id='3vyrQ'></bdo><ul id='3vyrQ'></ul>
    1. <legend id='3vyrQ'><style id='3vyrQ'><dir id='3vyrQ'><q id='3vyrQ'></q></dir></style></legend>

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

        XmlHttpRequest onprogress 间隔

        XmlHttpRequest onprogress interval(XmlHttpRequest onprogress 间隔)

        <legend id='DGn01'><style id='DGn01'><dir id='DGn01'><q id='DGn01'></q></dir></style></legend>
          • <tfoot id='DGn01'></tfoot>
                  <bdo id='DGn01'></bdo><ul id='DGn01'></ul>
                    <tbody id='DGn01'></tbody>
                • <small id='DGn01'></small><noframes id='DGn01'>

                • <i id='DGn01'><tr id='DGn01'><dt id='DGn01'><q id='DGn01'><span id='DGn01'><b id='DGn01'><form id='DGn01'><ins id='DGn01'></ins><ul id='DGn01'></ul><sub id='DGn01'></sub></form><legend id='DGn01'></legend><bdo id='DGn01'><pre id='DGn01'><center id='DGn01'></center></pre></bdo></b><th id='DGn01'></th></span></q></dt></tr></i><div id='DGn01'><tfoot id='DGn01'></tfoot><dl id='DGn01'><fieldset id='DGn01'></fieldset></dl></div>
                  本文介绍了XmlHttpRequest onprogress 间隔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!


                  我正在使用 XmlHttpRequests 将图像上传到服务器,我想向用户显示这些上传的进度.

                  I'm using XmlHttpRequests to upload images to a server and I'd like to show the user the progress of these uploads.

                  不幸的是,对我的 onprogress-event 处理程序的调用之间的间隔太大.对于 500k 的图像,通常只调用一次或两次 onprogress.

                  Unfortunately the interval between calls to my onprogress-event handler is too large. Usually onprogress is called only once or twice for a 500k image.


                  /* This function is not called often enough */
                  function progress(e){
                      console.log('Uploading: ' + Math.round((e.loaded / e.total) * 100) + ' %');
                  var xhr = new XMLHttpRequest();
                  xhr.upload.addEventListener('progress', progress, false);


                  Can this behaviour be changed or is this hardcoded somewhere in the browser implementation?


                  W3 在他们的 XMLHttpRequest 级别 2 文档.显然,跨浏览器的不同级别的一致性是可以预料的.

                  The W3 sets forth the following guidelines in their XMLHttpRequest Level 2 document. Obviously varying levels of conformance across browsers are to be expected.


                  当请求实体正文被上传并且上传完成标志为假时,排队一个任务以在 XMLHttpRequestUpload 对象上触发一个名为 progress 的进度事件,大约每 50 毫秒或传输的每个字节,以最不频繁的为准.- W3 XMLHttpRequest Level 2(粗体表示强调)

                  While the request entity body is being uploaded and the upload complete flag is false, queue a task to fire a progress event named progress at the XMLHttpRequestUpload object about every 50ms or for every byte transmitted, whichever is least frequent. - W3 XMLHttpRequest Level 2 (Bolded for emphasis)


                  如果说要发出进度通知,则在下载过程中,排队一个任务以触发一个名为 progress 的进度事件,大约每 50 毫秒或接收到的每个字节,以最不频繁的为准.- W3 XMLHttpRequest Level 2(粗体表示强调)

                  When it is said to make progress notifications, while the download is progressing, queue a task to fire a progress event named progress about every 50ms or for every byte received, whichever is least frequent. - W3 XMLHttpRequest Level 2 (Bolded for emphasis)

                  我不知道自定义此功能的 api.

                  I am not aware of an api to customize this functionality.

                  这篇关于XmlHttpRequest onprogress 间隔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!



                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在调用 abort (jQuery) 之后,浏览器也会等待 ajax 调用完成)
                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不适用于 IE?)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 无法加载,请求的资源上不存在“Access-Control-Allow-Origin标头) - IT屋-程序员软件开发技术分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 请求是否有可能不遵循重定向 (301 302))
                  NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 异常 101)
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分内容)
                    <tbody id='F4ewJ'></tbody>

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

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

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