jquery not defined error
-
Hey there,
I’ve got this plugin installed on a new site that’s currently in development.
I am using a custom theme, and a custom version of jQuery.
I unregister the built in jQuery and register and enqueue my own version.
The issue is that the cookie code –
jQuery(document).ready(function(){ if(!catapultReadCookie("catAccCookies")){//If the cookie has not been set jQuery("#catapult-cookie-bar").show(); jQuery("html").css("margin-top","30px"); } });
is being loaded at the start of wp_footer, which is before jQuery is being loaded.
By changing
add_action ( 'wp_footer', 'catapult_add_cookie_js' );
to
add_action ( 'wp_footer', 'catapult_add_cookie_js', 1000 );
It made the code load after jquery had loaded in the footer.
My question is – would it be possible for you to add this to the plugin as default or optional behavior?
Many Thanks,
Mike
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘jquery not defined error’ is closed to new replies.