views:

60

answers:

1

Hey all, I'm at a complete loss here. A client of mine uses IE6 internally and for some reason even the simplest jQuery does not work. Here is the code that will not work.

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title></title>
    <script type="text/javascript" src="js/jquery-1.4.2.js" />
    <script type="text/javascript">

        jQuery(function() {
            alert("alert from jQuery");
        });

        $(document).ready(function() {
            alert("alert from doc.ready");
        });


    </script>

</head>
<body>

</body>
</html>

I know that there are a lot of issues with IE6. Ive tried a bunch of the workarounds that I found on the internet (like putting the script at the bottom of the page, removing the type attr) and no dice. any help would be greatly appreciated.

+6  A: 

This will not work in a lot of browsers actually because you've not included the script properly. You must do the following:

<script type="text/javascript" src="js/jquery-1.4.2.js"></script>

The script tags must be done as above or the script will not be included.

GenericTypeTea
Correct. This one bit me a few times.
Peter J
@Peter J - Same. I think it's happened to everyone at least once.
GenericTypeTea
@GenericTypeTea, @Peter J, had it been only once I'd be quite *proud* of myself...
David Thomas
On my desk there is a small list of mistakes that I tend to make from time to time. Each time I make a mistake that's on the list, I force myself to turn off my monitor and walk away for a few minutes.This mistake is on that list.
Justin R.
@GenericTypeTea: You hit it on the nose....closing the script tag as you describe above corrected the problem. Thanks very much.
Alex