jQuery conditional based on cookie

Hi there,

I have a page which displays some text based on a cookie that is set. What I would like to do is to over-ride that text/html by using an if statement based on the cookie.

I have the following, but not having any luck with it:

if ($.cookie('cookie_name')=='cookie_value'){
  alert("true");
  $("#box").html("new text");
}

Any ideas what I have wrong?

Thanks!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.