views:

55

answers:

2

I have the code below. IE8 displays a smaller height. The difference is over 100 pixels. It works fine in FireFox. Why doesn't it work right in IE?

<html>
<body>

    <script type="text/javascript" src='<%=ResolveUrl("~/includes/jquery-1.4.2.min.js") %>'></script>

    <script type="text/javascript">
       window.onresize = ff;

    function ff()
    {
     window.status = jQuery(window).height() ;
     }
    </script>

</body>
</html>
A: 

Did you specify a doctype? Usually things of this nature are more consistent in standards mode, whereas in quirksmode anything goes.

meder
The "Developer Tools" show what mode the browser is using, and lets you change it dynamically. (mentioned for the benefit of interested readers)
Pointy
You can also do `javascript:alert( document.compatMode )` in the address bar. CSS1Compat is what you want. If you don't see it, throw a doctype in.
meder
+1  A: 

Silly me. The browser had zoom turned on to 125%!

Tony_Henrich