title: Jquery Cookie Function
body: <p>I'm still quite new to this so please bear with me. I have a function which adds a class on a click event, this works fine. But I would also like the clicked function to be saved as a cookie so when that user next visits the site those classes are still there/reapplied. I'm using jquery.cookie for this. My code is as follows. </p>
  
  <pre><code>$(".bblue").click(function bblue() {
      $("dl").addClass("bbluebg");
      $("dd .button").addClass("buttonb");
      $('.button img').attr('src',function(i,e){return e.replace("White","DBlue");});
      $.cookie("color", function bblue(){} , { expires: null, path: '/' });
  });
  </code></pre>
  
  <p>When I call <code>$.cookie('color');</code> is returns <code>function bblue(){}</code> but it doesn't run the function when the page loads next.</p>