Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery cookie plugin - $cookies is not defined

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

like image 471
Ben Holland Avatar asked Jan 24 '11 22:01

Ben Holland


2 Answers

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?

like image 108
hollandben Avatar answered Sep 24 '22 21:09

hollandben


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.

like image 44
Chandu Avatar answered Sep 25 '22 21:09

Chandu