Skip to content

Instantly share code, notes, and snippets.

@jonahwilliams
Created November 11, 2025 00:55
Show Gist options
  • Select an option

  • Save jonahwilliams/470ec0279c079472f9b1272e6d3a932f to your computer and use it in GitHub Desktop.

Select an option

Save jonahwilliams/470ec0279c079472f9b1272e6d3a932f to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<head>
<title>Screen Size Test</title>
</head>
<body>
<div id="foo"></div>
<script type="text/javascript">
function computeSize() {
var width = window.screen.width;
var height = window.screen.height;
document.getElementById("foo").textContent = "Size is " + width + " x " + height;
console.log("updated");
}
computeSize();
setInterval(computeSize, 1000);
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment