# JavaScript Res Detection in Firefox

**URL:** <https://forum.kirupa.com/t/javascript-res-detection-in-firefox/160465>\
**Category:** web dev\
**Created:** [August 26, 2005, 3:42am UTC](https://forum.kirupa.com/t/javascript-res-detection-in-firefox/160465 "2005-08-26T03:42:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ERNANDE](https://avatars.discourse-cdn.com/v4/letter/e/4af34b/32.png) [@ERNANDE](https://forum.kirupa.com/u/ERNANDE)\
**Post date:** [August 26, 2005, 3:42am UTC](https://forum.kirupa.com/t/javascript-res-detection-in-firefox/160465/1 "2005-08-26T03:42:44Z")

</div>

I’m trying to use a JavaScript detection to determine the user’s screen resolution. My script works fine in every browser except Firefox. No matter what resolution I use, my alert notifies me that I’m using 1024x768.

What could I be doing wrong?

```auto

<html>
<head>

<script language="Javascript1.1">
 
function detect(){
if(screen.height<864){
alert("Sorry. your current resolution is "+screen.width+" by "+screen.height+". If possible please change your 
resolution.")
}
else{
alert("Whoa, nice resolution.")
}
 
}

</script>
</head>

<body onLoad="detect()">
</body>

</html>

```
