why my array is losing it's contents when I refresh the page?
- by Fernando SBS
I have created an:
var checkboxFarm = new Array();
then I want to record a checkbox status in that array, as there are 11 checkboxes.
Button.addEventListener("click", function() {
rp_farmAtivada(index);
}, false);
when clicked change the variable in the array:
function rp_farmAtivada(index) {
checkboxFarm[index] = !checkboxFarm[index];
};
but every time I refresh the page it loses all the checkboxes status and I'm aware that all that array gets the "undefined" value.
the checkboxFarm array is defined in the beginning of the script, so it should have a global scope.
Am I missing something?