Display Sizes (Screen vs Available) [BASIC]
As a programmer, often you need to either know the size of the user’s screen (basically their resolution); or the more important available space inside their browser where you can display your content. You avoid less clipping and display issues if you can distinguish the two.
function getWidth(){ if(document.all){ return document.body.clientWidth; }else{ return innerWidth; } }; function getHeight(){ if(document.all){ return document.body.clientHeight; }else{ return innerHeight; } }; document.writeln("Screen Size : " + screen.width + " x " + screen.height + " (Includes Everything on Screen)<br/>"); document.writeln("Width: " + getWidth() + " x Height: " + getHeight() + " (What's Available INSIDE the Browser)");DEMO | DOWNLOAD