Safari javascript cookie issue

Posted by Aaron Moodie on Stack Overflow See other posts from Stack Overflow or by Aaron Moodie
Published on 2010-06-17T03:59:24Z Indexed on 2010/06/17 4:03 UTC
Read the original article Hit count: 271

Filed under:
|
|

I've hit a bit of a weird issue in Safari in regards to setting a js cookie. The cookie itself is just a rgb colour value, which gets set using .click(), and is working fine in Chrome and Firefox, yet in Safari the value of the cookie is incomplete, showing up as rgb(193 instead of rgb(193, 184, 76) as the other browsers do.

The jQuery function I'm using to set the cookie is:

$('.project_link a').click(function() {
    var link_colour = $(this).css("color");
    document.cookie = "colour="+link_colour+";expires=;path=/";
});

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about cookies