0
<html>
    <script src="../jquery.js" type="text/javascript"></script>
    <body>
    </body>
    <script type="text/javascript">
        $(":hidden").show();
    </script>
</html>

Firefox 3.6 would show $(":hidden").show();, but IE 8.0 works fine. Is this a bug?

PS: I'm using jquery 1.4.2.

Thanks.

Jichao
  • 40,341
  • 47
  • 125
  • 198

1 Answers1

2

Probably because it is outside the closing body tag, i.e. </body>.

Why is it there?

alex
  • 479,566
  • 201
  • 878
  • 984
  • Not exactly. Actually you could put the script anywhere after the load of jquery.js. – Jichao Sep 24 '10 at 05:48
  • @Jichao Are you saying the browser renders the JavaScript code, and doesn't execute it? Also, you say you could put it anywhere, but why would you? – alex Sep 24 '10 at 05:52
  • I mean FF execute the JavaScript code but not correctly. If it execute like IE does, FF should not render the JavaScript code. I said you could put it anywhere is to prove that it is not because `it is outside the closing body tag`. – Jichao Sep 24 '10 at 06:08