is not a function at eval (eval at RenderData)
anybody know about it? as I know it is a function.
the code is here:
var storeInLocalStorage = function(stateStore) {
var States;
if (localStorage.getItem('states') === null) {
states = [];
} else {
states = JSON.parse(localStorage.getItem('states'));
}
states.push(stateStore);
localStorage.setItem('states', JSON.stringify(states));
}
storeInLocalStorage(newState)
the code try to see if any state array is there in the local storage and if yes, it will give the values to "states" or no it will make a new array states and try to push a new value to it and then save it in local storage
The problem is not the function, but that it is not available to the context where you attempt to call it
but I use it after definition. JSON could be the problem? the workspace have not some js tools like es6
I need to test this
I'll be so thankful of you.
I get no error btw
Ah ok. anyway thanks. I will try another way.
Обсуждают сегодня