Today, when I was making a pop-up dialog, I used the method of taking the width and height of the parent page.
After trying several methods, such as document.body.clientWidth, window.screen.width, document.body.scrollWidth and other methods, I found that none of them were the results I wanted. Later, I discovered an efficient method, and I immediately shared it:
Add breakpoints to debug [debugger] where you need to take the height and width, and then enter document.body in the monitoring page to view all the properties of the body to see which result is what you need. If it is not suitable, you can also enter window, and then look at Let’s see if there are suitable properties under window. Today, my problem solving is solved in this way. The properties are window.innerWidth and window.innerHeight.
I hope everyone can avoid detours when encountering such problems.