How can the mobile terminal correctly obtain the width and height of the browser

  node.js, question

I usually use this to get document.documentelement.clientwidth; document.documentElement.clientHeight; However, I just found out that some people do not apply these two attributes to ask how they accurately get the width and height of the browser.

Window.innerHeight get screen height window.innerWidth get screen width