Uncaught ReferenceError: cli_show_cookiebar is not defined
-
I’m trying to get working the plugin in localhost. I’ve readed all FAQ’s and have no solution.
I’ve deactivated all plugins except cookie law info, and still get the error.
Does anyone know why this can happen?
Thanks in advance.
-
Hi, if you have disabled absolutely every other plugin (no exceptions!) and you still have an issue then it could be an issue with your theme. The plugin has been tested on the latest WP version with the standard themes and it works.
Some pointers: what else does your JavaScript console say? Check the page source and make sure the following elements are there:
<script type=’text/javascript’ src=’http://www.cookielawinfo.com/wp-content/plugins/cookie-law-info/js/cookielawinfo.js’></script>
(there might be a version number at the end of the “.js”, don’t worry about that)
and in the footer something similar to this:
<script type=”text/javascript”>
//<![CDATA[
jQuery(document).ready(function() {// Edit 09/05: remove globals and package into Object Literal, and removed the debug function
cli_show_cookiebar({
html: ‘<div id=”cookie-law-info-bar”><span>This website uses cookies to improve your experience. We\’ll assume you\’re ok with that, but you can opt-out if you wish.Accept Read More</span></div><div id=”cookie-law-info-again”><span id=”cookie_hdr_showagain”>Privacy & Cookies Policy</span></div>’,
settings: ‘{“animate_speed_hide”:”500″,”animate_speed_show”:”500″,”background”:”#fff”,”border”:”#444″,”border_on”:true,”button_1_button_colour”:”#176a34″,”button_1_button_hover”:”#12552a”,”button_1_link_colour”:”#fff”,”button_1_as_button”:true,”button_2_button_colour”:”#333″,”button_2_button_hover”:”#292929″,”button_2_link_colour”:”#444″,”button_2_as_button”:false,”font_family”:”inherit”,”notify_animate_hide”:true,”notify_animate_show”:false,”notify_div_id”:”#cookie-law-info-bar”,”notify_position_horizontal”:”right”,”notify_position_vertical”:”bottom”,”showagain_tab”:true,”showagain_background”:”#fff”,”showagain_border”:”#000″,”showagain_div_id”:”#cookie-law-info-again”,”showagain_x_position”:”100px”,”text”:”#000″,”show_once_yn”:true,”show_once”:”6000″}’
});});
//]]>
</script>If you don’t have one of these then you might be missing wp_head or wp_footer in your theme template files.
If it’s not one of these then it could be an issue elsewhere in the theme but unfortunately I probably can’t help with those kind of issues as they require access to your server.
To get a definitive answer though I’d need to look at your site so once published you could send me the URL.
All the best
RichardThanks for all Richard.
It seems it’s not loading this: <script type=’text/javascript’ src=’http://www.cookielawinfo.com/wp-content/plugins/cookie-law-info/js/cookielawinfo.js’></script>
I’ve checked and just before </head> it’s loading <?php wp_head(); ?>
So don’t know what can happen.
Thanks.
DiegoFirst, make sure you’re searching the HTML source for just “cookielawinfo.js” (the link above is from one of my websites)
If you’ve disabled all the plugins and you’re still getting that then it is presumably something with your theme. I’m not sure what else to suggest to be honest. You could try checking the JavaScript console- if there are any errors, start there. Sometimes something like jQuery has been declared incorrectly or even twice (very common, in fact!). You could also try doing a search across files for anything relating to wp_enqueue_script or just “.js” – the latter will bring up any cases where wp_enqueue_script isn’t being used and the scripts are being hard coded.
Finally, make sure that the template file you’re looking at (the one with wp_head) is actually the one being called (unlikely but worth a shot!)
Even if you choose a different cookie plugin to solve this, it sounds like there’s an issue with your theme that needs to be found, so I’d try and get to the bottom of it if I were you.
Best of luck
Hi Richard,
finally I solved it. In the functions.php there was a wp_deregister_script(‘jquery’); and that was messing with your plugin.
Thanks for the support!
Excellent, glad you got it fixed! I’ve not come across that as a root cause before so I’ll make a note for future reference to check for deregistering core scripts in the theme’s function file.
All the best
Perfect Richard!
Thanks again for all!
Best regards.
Diego
The topic ‘Uncaught ReferenceError: cli_show_cookiebar is not defined’ is closed to new replies.