views:

272

answers:

1

I've been struggling for days with getting rid of an error in IE, and to 'almost' no avail.

I just tried loading jquery 1.2.6 instead of 1.3.2, and the error has gone away (though the site is noticeably slower now).

However, I suspect I may be stuck with this solution. Is there a browser based way to include the script similar to the css conditional statements?

I can do it serverside if I need to, but client-side would be nice.

+3  A: 

You can use Conditional Comments to include script only for IE.

<!--[if IE]>
    <script type="text/javascript">
        /*  Do Stuff */
    </script>
<![endif]-->

To exclude a script block from IE:

<![if !IE]>
    <script type="text/javascript">
        /*  Do Stuff */
    </script>
<![endif]>
Ken Browning
but doing this means it will also load the other script if I can't specify NOT to load in IE.
pedalpete
I can't tell from your question that you're looking to run script on every browser *except* IE. The document I linked in the answer has an example of how to do this: <![if !IE]><p>You are not using Internet Explorer.</p><![endif]>
Ken Browning