0

Store data in localStorage

I open code on Android and instead of going into else scope and displaying message "Sorry, your browser does not support web storage..." I get the console log error "Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document"😕 can you explain why? Is there some fix for that?

30th Jul 2022, 9:45 PM
Marcin S
Marcin S - avatar
1 Answer
0
Marcin S localStorage is not a part of window document means you can directly use without document localStorage.setItem(key, value); localStorage.getItem(key); localStorage is a part of web so it will not work on Sololearn Playground.
31st Jul 2022, 4:48 AM
A͢J
A͢J - avatar