Hi,
I am trying to save 4 values to localstorage array, I have used the static code I got for the selectmenu array. I have tried to alter the code for the event onclick. but its wrong, but I had to start somewhere, can you tell me whats wrong with the event code
this is the error in console
static code
function save(item, varName) {
var arr = JSON.parse(localStorage.getItem(varName));
if(arr == null) {
arr = new Array();
}
arr.push(item);
localStorage.setItem(varName, JSON.stringify(arr))
}
function myload(varName) {
var arr = JSON.parse(localStorage.getItem(varName));
if(arr == null) {
arr = new Array();
}
return arr;
}
event on click
codesave({'Pizza':Tiggzi("chickenpizza_item_label").val(), 'Size':Tiggzi("orderlabel").val()},
'Base':Tiggzi("thin_deeptoggle").val()},
'Price':Tiggzi("chickenpizzaPricelabel").val()},
"liveoderArray");/code