I am using jquery cookie library to create cookie with jQuery. How can I update the cookie value? I need to create a new cookie, and if a cookie exists to update it. How can i do this? Code I received:
v.on('click', function(){ var d = $(this).attr('role'); if(d == 'yes') { glas = 'koristan.' }else { glas = 'nekoristan.' }; text = 'Ovaj komentar vam je bio ' + glas; //This part here create cookie if(id_u == 0){ $.cookie('010', id + '-' + d); } $.post('<?php echo base_url() ?>rating/rat_counter', {id : id, vote : d, id_u : id_u}, function(){ c.fadeOut('fast').empty().append('<p>' + text).hide().fadeIn('fast'); }); })
Sasha
source share