jquery.cookie.js file not found
For some reason the jquery.cookie.js file won’t load. I’ve checked the directory and it is there. Permissions are 755.
I get the following in the console:
Failed to load resource: the server responded with a status of 404 (Not Found)
This seems to be preventing the banner from showing.
My theme uses the wordpress jquery (wp-includes/js/jquery/jquery.js) and i’ve tried disabling all my theme scripts with no luck: you can check it out here:
If i change the name of jquery.cookie.js to jquerycookie.js or sausage.js then change
wp_enqueue_script( 'jquery-cookie', CLI_PLUGIN_URL . 'js/jquery.cookie.js', array('jquery') );
to match everything works?
It’s a mystery!
I would like to solve it as i’d rather not have to change the code on every update.
This will probably be a permissions error as you have already identified. As this is specific to your server and not plugin related its not something I could help with (requires access to the server to do so)
– is this local host, a server, if a server is it a shared host or dedicated? Find out what group you are a member of by using ‘whoami’ then ‘ls -ld’ to check who owns it
– how did you install the plugin: did you directly upload the code yourself (if so check which group you are a member of because that might be the issue) or did you install via the WP dashboard?
– try uninstalling and re-installing from the WP dashboard
Hope that helps
Sorry for not replying to this sooner. Just run into the same problem on another site, same server.
It’s a shared host, but I have ruled out a permissions error as other js files in the same folder (i.e. cookielawinfo.js) have the same permissions and they load fine.
On two separate occasions I have had the same 404 error for jquery.cookie.js.
I always install plugins from the WP dashboard and reinstalling the plugin has had no effect.
On both occasions changing the file name and the enqueue script call has solved the problem so i’m not desperate for a solution but it would be nice to know why this is happening! If anyone could shed some light on this that would be great.
thanks for the plugin though Richard, work is always appreciated 🙂
Just had an ‘aha’ moment – I think this is Apache mod_security related:
Or Google “jquery.cookie.js mod_security”
This still isn’t something I can help you with unfortunately as it’s your server not the code, but it should give you something more to go on. The solution you already found is a suggested fix, so you’re good to go but as you correctly point out, any updates to the plugin will overwrite your changes.
- The topic ‘jquery.cookie.js file not found’ is closed to new replies.