Salve,
con jquery faccio il parse del cookie poi JSON.stringify estraggo solo le keys con h2s come prime 3 lettere poi vorrei verificare se hanno valori vuoti o no ma non funziona...ecco il codice
un piccolo aiutino?codice:var test = JSON.parse($.cookie('configurationFormPre-treatment')); JSON.stringify(test, function(key, value) { // when encoutering one of the keys we're looking for, populate our own result if (key.substr(0, 3) == 'h2s') { if (value == "") { $("#img-checked-PRE-TREATMENT-icon-delete-h2s").css("opacity", "0.5"); $("#img-checked-PRE-TREATMENT-all-h2s").attr("src", "<?php echo THEMEURL;?>/images/checked-white-no.png"); }else{ $("#img-checked-PRE-TREATMENT-icon-delete-h2s").css("opacity", "1"); $("#img-checked-PRE-TREATMENT-all-h2s").attr("src", "<?php echo THEMEURL;?>/images/checked-white.png"); } } // in any case, don't break the normal generation of the JSON.parse result // (or the keys we select above would have been left empty!) });
grazie

Rispondi quotando