4 examples of 'document height' in JavaScript

Every line of 'document height' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
37function getDocHeight() {
38 return Math.max(
39 document.body.scrollHeight || 0,
40 document.documentElement.scrollHeight || 0,
41 document.body.offsetHeight || 0,
42 document.documentElement.offsetHeight || 0,
43 document.body.clientHeight || 0,
44 document.documentElement.clientHeight || 0
45 );
46}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

9function getDocHeight() {
10 var D = document;
11 return Math.max(
12 D.body.scrollHeight, D.documentElement.scrollHeight,
13 D.body.offsetHeight, D.documentElement.offsetHeight,
14 D.body.clientHeight, D.documentElement.clientHeight
15 );
16}
69public getTerminalHeight() {
70 return this.terminalSize.height;
71}
598function get_DisplayHeight () {
599 // FIXME
600 var canvas = JSIL.Host.getCanvas();
601 return canvas.height;
602}

Related snippets