Alex Rivera | Logout

Uncaught TypeError: Property '$' of object [object global] is not a function?

Asked 2010-01-16T22:26:42.760
16

I am getting the following error

Uncaught TypeError: Property '$' of object [object global] is not a function in line 2:

Using the following code:

$(document).ready(function() {
    $('#tabs > ul').tabs({ fx: { opacity: 'toggle' } });
    $('#featuredvid > ul').tabs();
});

The problem appears local at 127.0.0.1 only, while same code OK online! I'm dazzled, any ideas?

Edit
Report

3 Answers

6

I had pretty much same problem. The error message says

TypeError: $ is not a function
$(document).ready(function() {

The line in my code that was throwing error is this :

$(document).ready(function(){

In my case the problem is that $ is not recognized as jquery. I had to replace $ with the keyword jQuery. So finally i changed my code like this:

jQuery(document).ready(function(){

And it worked.

answered 2012-08-28T16:27:00.580
3

I got the same error and solve it by adding

var $ = jQuery;

as a global var on my script

answered 2013-06-20T14:40:53.960
0

It might be the version of jQuery or something along those lines. I had this exact problem - I was using a local copy of jQuery (version 1.3.2) and then switched to http://code.jquery.com/jquery-latest.pack.js and suddenly it worked (latest at the time was 1.4.1).

I also had some of the issues you mentioned about "Resource interpreted as script but transferred with MIME type text/plain". I think that's safe to ignore for this particular problem as it still shows up for me even though my javascript is working now.

answered 2010-01-29T05:50:44.730

Your Answer