views:

57

answers:

3

Hi to everyone, my problem is a plugin called "Sexy Alert Box" when I load the page, the firebug tells me that there is a problem:

$ is not a function

The line with the error shows...

$(document).ready(function(){

You can check the website HERE

and when I try to click on "Dile a un amigo" for open the box, because the plugin is not define it says

"Sexy is not defined"

I hope that you can help me to fix this, Thank you

+3  A: 

This is rather a wild guess from a short look at your source code, but it seems like you called var $jquery = jQuery.noConflict(); which means jQuery wont export the $ symbol, so you cant use $(document)... syntax you´ll have to use the $jquery or jQuery variable as you already did in your document. See the jquery documentation on this. Maybe your plugin does not support the noConflict mode and relies on the $ symbol to be available?

Max
I change it but still having the same problem, do u know how can I remove that code from the wp_head call?? I google it but I don't see it where they tell me...
Omegakenshin
@Omegakenshin it seems like the plugin is not prepared to work with jQuery noConflict, there is still a reference to $ in the code $.makeArray(...) if you replace that with jQuery.makeArray(...) I guess it should work. I wouldn´t change the code in the header as this would mean much more work imho. :-)
Max
same problem, guess there is something more...
Omegakenshin
@Omegakenshin really? Did you clear your browsers cache? The firebug console doesn´t show any errors at least on the site you linked to.
Max
Ok now I try with another plugin but its the same error, and I did it with jQuery and all... T^T why is there an error... I don't understand...
Omegakenshin
+2  A: 

It's because of this line I believe:

var $jquery = jQuery.noConflict(); 

on line 56 of you page.

It removes the $ binding so you have to user $jquery().

Its to allow compatibility with other frameworks that use $.

Change

$(document).ready(function(){

to

$jquery(document).ready(function(){
David Mårtensson
+2  A: 

used jQuery.noConflict() so instead of using $ try using $jquery there

sushil bharwani