smile_ajax is not defined

Hi this is my first post here, and my first real web project… this might be a stupid question but i have searched all over the web for an answer to this…

im using Jquery for an animated menu i made. It works well but it breaks some of the functions in my wordpress theme and i cant figure out why.

This is my script to initiate Jquery but i dont know why it breaks other things…

[php]if (!is_admin()) add_action(“wp_enqueue_scripts”, “my_jquery_enqueue”, 11);
function my_jquery_enqueue() {
wp_deregister_script(‘jquery’);
wp_register_script(‘jquery’, “http” . ($_SERVER[‘SERVER_PORT’] == 443 ? “s” : “”) . “://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js”, false, null);
wp_enqueue_script(‘jquery’);
}[/php]

I get an error in my inspector saying “smile_ajax is not defined”

any help here would be greatly appreciated :slight_smile:
-R

If you search through the (non minified) jquery file
http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js

You can see “smile_ajax” is not part of jquery.

I’d start with debugging in the browser console to see in which script the error is.

[hr]

Are you sure the template doesn’t already include Jquery? You can get all kinds of “fun” errors if you load jquery multiple times, especially if you load some scripts/plugins in between.

Ok ,thank you! the guys at x-theme support told me that it was Jquery. and based on my 13 hours working with this i am not one to discuss their answers…

My problem is that when i disable the code i posted above, my accordion tab works fine. When i enable the code again, it opens, but refuses to close. I tried debugging this, but i dont know where to start.

-R

When i disable the script, it stops working so i dont think so…

Checked everything once more and it turns out you were right! i was loading the jquery two times, one of them in the wrong way. Now its all good :slight_smile:

Thanks a lot!

Sponsor our Newsletter | Privacy Policy | Terms of Service