jQuery issue in Internet Explorer 8

Viewed 269689

I am trying to get my jQuery functions to work on IE8. I am loading the library from Google's servers (http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js).

The $(function(){}) is never called. Instead, I get an error Object expected. I opened the developer and ran typeof $ in the console, and it came up as undefined.

I have tried going to other sites that I know use jQuery (jquery.com), and those all work, is there something I might be missing here?

20 Answers

Correction:

Check your script include tag, is it using

type="application/javascript" src="/path/to/jquery" 

change to

type="text/javascript" src="/path/to/jquery" 

jQuery is not being loaded, this is not likely specific to IE8. Check the path on your jQuery include. statement. Or better yet, use the following to the CDN:

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js">
</script>

I had the same problems.

I solved it verifying that IE8 was not configured correctly to reach the SRC URL.

I changed this, it works right.

Related