Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

domReady与window.onload区别与认识 (domReady文件夹) #5

Open
zlluGitHub opened this issue Apr 10, 2018 · 0 comments
Open

Comments

@zlluGitHub
Copy link
Owner

  • document.ready和onload的区别——JavaScript文档加载完成事件页面加载完成有两种事件:

    1.ready,表示文档结构已经加载完成(不包含图片等非文字媒体文件)

    2.onload,指示页面包含图片等文件在内的所有元素都加载完成

  • window 的 onload 事件是在文档的所有资源都加载完成之后触发,包括 JS、CSS、文档里面的所有的图片,多媒体内容等等, 所以 onload 触发的会比 domReady 慢,比如有一个大图片,页面都已经展现出来了,图片还没加载完成,那么 onload 就不会被触发。(个人认为可以利用window.onload 事件这个可以页面加载的loading)。

  • 关于更多关于domReady的介绍请点击这里...

  • 查看全部代码请到这里...

@zlluGitHub zlluGitHub changed the title domReady与window.onloadq区别与认识 (domReady文件夹) domReady与window.onload区别与认识 (domReady文件夹) Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant