Reputation: 51
I have searched around and no other solution fits my problem.
I am using the jQuery cookie plugin to implement a show/hide section on my site.
When testing the site locally (using WAMP) my jQuery code shows no errors, yet once it's uploaded to my site, an error saying:
$.cookie is not a function
I have tried many different solutions so am thinking it might be something with the server my website is uploading to...
Any help is appreciated
$.cookie("slider", "hidden");
alert($.cookie("slider"));
www.visio-design.co.uk/dpgd/index.php
Upvotes: 5
Views: 10561
Reputation: 470
Contacting my web provider and having them disable the mod_security rule fixed this issue for me. This rule blocks files with .cookie in the name.
I tried several other fixes that can also work depending on your access level and configuration:
Adding:
<IfModule mod_security2.c>
SecRuleEngine Off
</IfModule>
to the VirtualHost entry of the domain in the Apache configuration file : Unfortunately I did not have access to override settings in the Apache configuration.
Hope this helps!
Upvotes: 0
Reputation: 322
cheers for the quick responses. i changed the name of the file from "jquery.cookie.js" to jquery.cooki.js" and its working fine.
would be great if anybody could give me an insight into why this is happening? i've read that it maybe something to do with my htaccess file?
Upvotes: 3
Reputation: 179046
You're getting a 406 error on loading your cookie.js
file. Make sure it's in the right place with the right permissions.
Edit to add:
The 406 error was viewed from within firebug checking out the contents of the script.
Upvotes: 0
Reputation: 26380
Double check that your jquery.cookie.js file is loaded on the server where you think it is. When I try to view it, I get a 404 error. It also mentions a 406 error, which is pretty unusual.
Upvotes: 1
Reputation: 82903
I have opened the site using firebug and there is a 404 error for the jquery.cookie.js. Make sure you copied the jquery.cookie.js file to the same path where the jquery-1.4.4.js and other js files exist.
Upvotes: 1