jQuery 1.6.1 , IE9 and SCRIPT5009: '$' is undefined
Asked Answered
R

3

4

There is

SCRIPT5009: '$' is undefined

<script type="text/javascript" src="xxx_files/jquery.js"></script>
<script type="text/javascript" src="xxx_files/jquery_002.js"></script>
<script type="text/javascript" src="xxx_files/ticker.js"></script>
<script type="text/javascript" src="xxx_files/config.js"></script>
<script type="text/javascript" src="xxx_files/ajax.js"></script>
<script type="text/javascript" src="xxx_files/lite.js"></script> 
<script type="text/javascript" src="xxx_files/jquery.pagination.js"> </script>
<script type="text/javascript">
$(document).ready(function(){
    $('#slide').pajinate({
          num_page_links_to_display : 0,
       items_per_page : 4
    });
 });
 </script>

with jQuery 1.6.1 in IE9 . Why '$' is undefined in ie9 ?

Thanks in advance

Rundell answered 1/6, 2011 at 15:38 Comment(1)
A good way to narrow it down is to take out every other .js include one by one and see if the error disappears.Onslaught
G
7

Do you have another script using jQuery before jQuery is referenced?

Gittel answered 1/6, 2011 at 15:40 Comment(3)
@Rundell - have you checked firebug/dev tools to make sure that "xxx_files/jquery.js" is actually loading, and you aren't getting an HTTP 404 error?Gittel
there is no any error in firebug. The error isonly in ie. Chrome and ff has not any errors.Rundell
I have changed the file names and the problem is solved. Thanks BrettRundell
W
3

FOR BEGINNERS:

add this code to your file:

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

It'll grab the jQuery file from google cdn (according to http://www.w3schools.com/jquery/jquery_intro.asp) I was having this problem

Warbeck answered 6/6, 2012 at 18:54 Comment(0)
C
2

This issue is because there is no reference in the page for jquery...Pleaes ensure that the below js reference or above jquery-1.5.1.min.js is added as reference

<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
Colangelo answered 16/2, 2012 at 5:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.