Andrei RRR
Andrei RRR

Reputation: 3162

Jquery Cookies Error

I have this bit of code where I try to set a cookie using jQuery before redirecting to another page:

$(document).ready(function() {

   $("#offers-categories").click(function () {
      $.cookie("cardType", "1");
      window.location = "categories.html";
   });

});

This is the error that I get in the Console when I click the #offers-categories div:

Uncaught TypeError: Object function (e,t){return new st.fn.init(e,t,X)} has no method 'cookie' 

What I am doing wrong here?

Upvotes: 1

Views: 682

Answers (1)

hohner
hohner

Reputation: 11588

Are you using the jQuery cookie plugin? There is no cookie method in standard jQuery.

Upvotes: 3

Related Questions