views:

42

answers:

2

When I try to load my page that uses jquery, when the following line is hit:

if ($.cookie('compare') != null) 

I get the error $.cookie is not a function. Has anybody seen this before?

+3  A: 

That means that the $.cookie plugin isn't being included in the page, at least not being it's getting called. Make sure it's both being included, and is being included before it's getting used. Include it just after jQuery itself to be safe.

Just a tip: Several other plugins rely on the cookie plugin (but don't necessarily check if it exists before calling it), you could be using one.

Nick Craver
This was the problem, it seems that my hosting provider was having a problem loading jquery.cookie.js, renaming to jqueryycookie.js solved the problem
Introgy
+2  A: 

Do you have the jQuery cookie plugin?

klausbyskov