Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 638
Olivers Avatar asked Jan 16 '10 22:01

Olivers


People also ask

How do I fix uncaught TypeError is not a function?

The TypeError: "x" is not a function can be fixed using the following suggestions: Paying attention to detail in code and minimizing typos. Importing the correct and relevant script libraries used in code. Making sure the called property of an object is actually a function.

Why is JavaScript function undefined?

A variable that has not been assigned a value is of type undefined . A method or statement also returns undefined if the variable that is being evaluated does not have an assigned value. A function returns undefined if a value was not returned .

Is not a function in '$( this )' '$' is undefined?

This is a common JavaScript error that happens when you try to call a function before it is defined. You get this error when you try to execute a function that is uninitialized or improperly initialized . It means that the expression did not return a function object.

What is uncaught type error?

According to the Mozilla website for developer documents, “the TypeError object represents an error when a value is not of the expected type.” Uncaught means that the error was not caught in the catch part of the try-catch block.


1 Answers

I ran into this error when I was trying to use the slide effect that I thought was part of jQuery but was actually a jQuery UI effect. This was the output from my console:

Uncaught TypeError: Property '#<Object>' of object #<Object> is not a function

So, to me it seems like you just need to include the jquery UI library. Add this line after you include jQuery.

<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
like image 82
simoes Avatar answered Oct 21 '22 15:10

simoes