jQuery cookies and .each() help requested -
hi i'm using jquery-cookies plugin (http://plugins.jquery.com/project/cookie) , it's great setting , deleting cookies when know are.
what i'd accomplish have script read extant cookies , each cookie exists, something. i'm using looks this:
--
// set dummy cookies $.cookie('cookie_name', 'cookie_value'); $.cookie('2', '2_value'); $.cookie('3', '3_value'); $.cookie('4', '4_value'); // returns "cookie_value" alert, know above cookies set , scripts included: alert($.cookie('cookie_name')); // debug (working) // each cookie found, check input same id - pop alert, debug $.cookie(i,v).each(function(v) { $('input#' + v + ').attr('checked', true); alert(v); // debug (not working) });
--
... .each statement doesn't squat. it's matter of syntax documentation cookie plugin doesn't cover well. have ideas? thank in advance , please let me know if can provide more information.
you have quote:
$('input#' + v + ').attr('checked', true); problem----------^
should be:
$('input#' + v).attr('checked', true);
Comments
Post a Comment