views:

33

answers:

1
<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.

+2  A: 

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

Why is it there?

alex
@alex: Not exactly. Actually you could put the script anywhere after the load of jquery.js.
Jichao
@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
@alex: 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