javascript - cookie is not a function -
cookie plugin included , working fine on first click, when try click on link different data-id have error $.cookie not function, cookie can not updated new value
$(document).ready(function(){ $('#row').live('click',function(){ var msg_id = $(this).data('id'); $('#table_2').html('loading...'); $.cookie("chat_", msg_id, { expires: 1 }); $('#table_2').load('http://google.com/mail_ajax.php?id='+msg_id,function(){ $("#table_2").html(); }); }); var chat_d = $.cookie('chat_'); var timeout = setinterval(reloadchat, 3000); function reloadchat () { $('#table_2').load('http://google.com/mail2ajax.php?id='+chat_d); } });
why can't update cookie on 2nd click, , can problem ?
Comments
Post a Comment