判断图片是否读取完成

eMooMe 2005-06-28 07:15:43
请问怎样可以判断网页中的一副图片是否读取完成?
写在<img>的onload里可以吗?
...全文
74 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
springwood 2005-06-29
  • 打赏
  • 举报
回复
Retrieves the current state of the object.

Syntax

HTML N/A
Scripting [ vState = ] object.readyState

Possible Values

vState Variant that receives one of the following values.uninitialized Object is not initialized with data.
loading Object is loading its data.
loaded Object has finished loading its data.
interactive User can interact with the object even though it is not fully loaded.
complete Object is completely initialized.


The property is read-only. The property has no default value.

Remarks

The states through which an object passes are determined by that object; an object can skip certain states (for example, interactive) if those states do not apply to that object.

Standards Information

There is no public standard that applies to this property.

springwood 2005-06-29
  • 打赏
  • 举报
回复
readyState
eMooMe 2005-06-28
  • 打赏
  • 举报
回复
如果想在图片加载结束后触发一个事件,应该怎么写呢?
kendo7 2005-06-28
  • 打赏
  • 举报
回复
<img onerror="alert('你的图片加载失败')" src="a.jpg">

87,921

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧