property of [object DOMWindow] is not a function I get: Uncaught TypeError: the '
property of [object DOMWindow] is not a function - javascript โ†™๏ธ โฐ ๐Ÿคฑ๐Ÿป
property of the [object DOMWindow] ...">
property of [object DOMWindow] is not a function - javascript โ†™๏ธ โฐ ๐Ÿคฑ๐Ÿป

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

I get: Uncaught TypeError: the '$' property of the [object DOMWindow] object is not an error function 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?

+8
javascript jquery
source share
5 answers

Chrome loads other libraries that use the $ symbol for other purposes, so you need to use jquery without conflict. on the way - change $ character with jQuery

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

change to

 jQuery(function(){...}); 
+18
source share

My assumption is that jquery was not loaded before running one of these methods, so it did not turn on before running these methods, or some error that prevented it from loading properly. Usually this should "just work" (at least not cause such an error message)

 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> function showSlidingDiv() { $("#slidingDiv").fadeToggle("slow", "linear"); } function showSlidingDiv2() { $("#slidingDiv2").fadeToggle("slow", "linear"); } function showSlidingDiv3() { $("#slidingDiv3").fadeToggle("slow", "linear"); } </script> 
+6
source share

No time. I found a solution that worked for me.

Instead

 $("#slidingDiv") 

to try

 jQuery("#slidingDiv") 

other options were not helpful to me.

+1
source share
 <script type="text/javascript"> var j = jQuery; function showSlidingDiv() { j("#slidingDiv").fadeToggle("slow", "linear"); } function showSlidingDiv2() { j("#slidingDiv2").fadeToggle("slow", "linear"); } function showSlidingDiv3() { j("#slidingDiv3").fadeToggle("slow", "linear"); } </script> 
0
source share

make sure jQuery.noConflict () is not being called. Calling this will not allow the use of the abbreviated record $.

0
source share

All Articles