IE11 javascript screen resolution

I have a strange situation. Simple code like this

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title></title>
    <script>
        function checkScreen()
        {
            alert(window.screen.width);
            alert(window.screen.height);
        }
        checkScreen();
    </script>
    </head>
    <body>
    </body>
</html>

It works on all browsers and shows me my screen resolution (1920x1080), but in IE 11 it shows 1812x1029. After searching, I did not find anything that could help me understand why IE gets these values ​​from js (this is not even a viewport). If someone can illuminate me in this situation, it will be a big help. Thanks.

+4
source share
2 answers

What is the zoom level of IE? According to MDN ,

"Internet Explorer , . , 100%."

+2

jQuery, :

$(window).width();
$(window).height();

.

: , "-jquery":

var w = window,
d = document,
e = d.documentElement,
g = d.getElementsByTagName('body')[0],
width = w.innerWidth || e.clientWidth || g.clientWidth,
height = w.innerHeight|| e.clientHeight|| g.clientHeight;
alert(width);
alert(height);
-4

All Articles