博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ajax ----进度条的原理
阅读量:6820 次
发布时间:2019-06-26

本文共 1563 字,大约阅读时间需要 5 分钟。

 

一、进度条的原理

新知识点:Html5中FormData,xmlHttpRequest中的upload属性,progress事件监控

xmlHttpRequest中的upload属性,实现:

1  2  3  4     
5 Document 6 7 8 9 10
11
12
13
14 15 16 17 85 86

 

 

 xmlhtmlrequest.upload属性下面的方法有: 来源

Event listeners Data type of response property
onloadstart The fetch starts
onprogress Data transfer is going on
onabort The fetch operation was aborted
onerror The fetch failed
onload The fetch succeeded
ontimeout The fetch operation didn't complete by the timeout the author specified
onloadend The fetch operation completed (either success or failure)

 

通过progress事件,实现:

1  2  3  4     
5 Document 6 7 8 9 10
11
12
13
14 15 16 17 54

 

Property Type Description
target 只读 The event target (the topmost target in the DOM tree).
type 只读 The type of event.
bubbles 只读 Whether the event normally bubbles or not
cancelable 只读 Whether the event is cancellable or not?
lengthComputable boolean Specifies whether or not the total size of the transfer is known. Read only.
loaded unsigned long (long) The number of bytes transferred since the beginning of the operation. This doesn't include headers and other overhead, but only the content itself. Read only.
total unsigned long (long) The total number of bytes of content that will be transferred during the operation. If the total size is unknown, this value is zero. Read only.

转载于:https://www.cnblogs.com/blog-index/p/6619101.html

你可能感兴趣的文章
最新一代企业管理软件功能介绍
查看>>
12 种编程语言的起源故事
查看>>
Linux crond 定时任务
查看>>
linux 文件删除详解
查看>>
linux下虚拟终端terminator安装和使用
查看>>
Java多线程学习(六)Lock锁的使用
查看>>
java异常处理的机制 java 架构师学习 java北京
查看>>
史上最全Python数据类型详解
查看>>
青藤出品:【重磅】2017年云安全预测
查看>>
Python赋值混淆例题分析与三双单引号使用
查看>>
Linux基础知识
查看>>
学习的本质,不在于记住多少知识,而是它触发了你哪些思考
查看>>
实现NAT模式的LVS
查看>>
Memcached与Redis(二)
查看>>
docker-3:docker swarm群集初部署
查看>>
保留两位小数
查看>>
CentOS7.6破解root口令之方法一
查看>>
思科配置命令
查看>>
python --001简介
查看>>
Changing the Filter of a List Collector Variable v
查看>>