Examining the code snippet provided below:
document.documentElement.clientWidth
1349
document.documentElement.clientHeight
363
window.innerWidth
1366
window.innerHeight
363
window.screen.height
768
window.screen.width
1366
Therefore, my desktop screen has a width of 1366px and a height of 768px.
I have acquired knowledge that:
The viewport dimensions are accessed using
document.documentElement.clientWidth
and document.documentElement.clientHeight
.
Whereas window dimensions are accessed using window.innerWidth
and window.innerHeight
.
1) What sets apart the viewport from the document?
2) Under what circumstances does window.onload
differ from document.onload
in terms of invocation?