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 theready
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
2 Answers
Reset to default 5it 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.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744185377a4562182.html
评论列表(0条)