1

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?

Andrei RRR
  • 3,068
  • 16
  • 44
  • 75
  • Duplicate of this question: http://stackoverflow.com/questions/4034190/cookie-is-not-a-function – flytzen Jan 20 '13 at 13:02

1 Answers1

3

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

hohner
  • 11,498
  • 8
  • 49
  • 84