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

GSerg
  • 76,472
  • 17
  • 159
  • 346
utopia
  • 179
  • 1
  • 1
  • 10
  • 2
    A good way to narrow it down is to take out every other `.js` include one by one and see if the error disappears. – DarthJDG Jun 01 '11 at 15:56

3 Answers3

7

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

Brett
  • 4,051
  • 2
  • 26
  • 39
  • 1
    @utopia - 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? – Brett Jun 01 '11 at 15:45
  • there is no any error in firebug. The error isonly in ie. Chrome and ff has not any errors. – utopia Jun 01 '11 at 15:51
  • I have changed the file names and the problem is solved. Thanks Brett – utopia Jun 01 '11 at 15:59
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

SZT
  • 1,771
  • 4
  • 26
  • 53
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>
Sobs
  • 21
  • 1