最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - window.onload include images - Stack Overflow

programmeradmin7浏览0评论

Does window.onlaod include image load? or I must use another event for it?

I want use ajax call to get HTML document which contains images, but I want show this document when all images are loaded.

Does window.onlaod include image load? or I must use another event for it?

I want use ajax call to get HTML document which contains images, but I want show this document when all images are loaded.

Share Improve this question edited Jan 5, 2021 at 3:33 Jason Aller 3,65228 gold badges41 silver badges39 bronze badges asked Feb 12, 2013 at 19:37 Taron MehrabyanTaron Mehrabyan 2,2293 gold badges21 silver badges27 bronze badges 12
  • window.onload waits for images. That's why jQuery jumps through the loops to provide you the ready event – John Dvorak Commented Feb 12, 2013 at 19:40
  • Have a look here : stackoverflow./questions/3520780/when-is-window-onload-fired – sdespont Commented Feb 12, 2013 at 19:41
  • @JanDvorak; It means jQuery ready waits for images??? – Taron Mehrabyan Commented Feb 12, 2013 at 19:42
  • 1 @TaronPro No. He's saying that jQuery (and most other frameworks) endeavor to provide developers with an "onReady" event that fires when DOM is ready -- which is quite different from when the images are loaded. Javascript needs the DOM, it doesn't need the images. – Chris Baker Commented Feb 12, 2013 at 19:44
  • 1 Am I the only one here to see that the OP is talking about an ajax call? – Christophe Commented Feb 12, 2013 at 20:00
 |  Show 7 more ments

2 Answers 2

Reset to default 5

it does include all webpage's resource's load - more information here: https://developer.mozilla/en/docs/DOM/window.onload

Yep, in short it waits for whole visual content to e together, it will trigger after the pletion of the load of all the images, all the frames and their contents.

发布评论

评论列表(0)

  1. 暂无评论