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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That means that the
$.cookieplugin isn’t being included in the page, at least not before 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.