Похожие чаты

Hi ! I got this error : Uncaught TypeError: storeInLocalStorage

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)

7 ответов

10 просмотров
AlY- Автор вопроса

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

AlY- Автор вопроса
Misan
The problem is not the function, but that it is no...

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

AlY- Автор вопроса
Misan
I need to test this

I'll be so thankful of you.

I get no error btw

AlY- Автор вопроса
Misan
I get no error btw

Ah ok. anyway thanks. I will try another way.

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта