Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am getting an : Uncaught TypeError: Property '$' of object [object DOMWindow] is not a function error in Chrome with my script.

<script type="text/javascript"> 
    function showSlidingDiv() {
        $("#slidingDiv").fadeToggle("slow", "linear");
    }
    function showSlidingDiv2() {
        $("#slidingDiv2").fadeToggle("slow", "linear");
    }         
    function showSlidingDiv3() {
        $("#slidingDiv3").fadeToggle("slow", "linear");
    }
</script> 

Does anyone know what could be wrong here?

like image 314
Jasper Avatar asked Aug 09 '11 07:08

Jasper


1 Answers

Chrome does load other libraries that make the use of $ symbol on other purposes, so you have to use jquery no conflict. on of the way is to change the $ symbol with jQuery

$(function(){...});

change to

jQuery(function(){...});
like image 144
sanusi Avatar answered Sep 21 '22 18:09

sanusi