Questions tagged [local-storage]
LocalStorage is a way to store persistent data using JavaScript (see also: SessionStorage).
9,404
questions
0
votes
0
answers
8
views
How to use formset to get data from localstorage - DJANGO
i want to get data from local storage (because i don't use database), i use form NOT MODALS.
views.py :
def homepage(request):
form_class = Audio_store
form = form_class(request.POST or None)
...
0
votes
0
answers
9
views
Save localStorage for next run in Selenium Python Firefox
I'm using Selenium in Python with Firefox browser.
I want to save cookies and localStorage between each Selenium sessions. I first tried start Firefox using specified Profile. But it reports me:
...
-1
votes
0
answers
26
views
Cheat Detection in HTML 5 Games
I am trying to prevent people from using Cheat Engine and other exploits in my HTML 5 Games.
So after some googling I couldn't really find anything concrete - other than that the google task manager ...
0
votes
0
answers
13
views
how to get data (mp3) from local storage and can be played in html - DJANGO FORMS
i was new in django. i want to get my mp3 song what was i uploaded it and can be pass to html. how to get the song and return it? i build it with FORM not models.
forms.py :
from django import forms
...
-1
votes
0
answers
13
views
Dell EMC VNXe 5600 storage pool
Storage pool state " offline " and not know how to The problem happened
I can Solve the Problem to convert the state to online or deleted the storage pool ???
0
votes
0
answers
43
views
How to protect Dashboard page from unauthenticated user in an SPA with Laravel and Vuejs
When a user logs in I'm storing the status in local storage as shown below using and they get redirected to their dashboard. The dashboard is viewable when we have authenticated = 'true' in the local ...
0
votes
1
answer
23
views
Prevent duplicate objects but update quantity in shopping cart ReactJS/NextJS
Im having touble with a shopping cart in NextJS, I'm trying to update the Cart when someone clicks the "Add to cart" button in the product page. Im using LocalStorage.
export const ...
0
votes
0
answers
23
views
Trying to save value in local storage
function mySystem() {
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)');toggleDarkTheme(prefersDark.matches);prefersDark.addListener((mediaQuery) => toggleDarkTheme(mediaQuery....
0
votes
0
answers
14
views
How to get values from chrome.storage in a forEach loop?
I am creating an extension that stores selected text in local and retrieves that value and prints it in an ongoing list.
Each time the text is selected and added, it is added to the noteList.
if(...
0
votes
3
answers
39
views
How to display localStorage value in a table header?
I have the following js function that is used to get the saved value of an input field:
function getSavedValue(e) {
if (!localStorage.getItem(e)) {
return "";
}
return ...
0
votes
1
answer
19
views
Access to Local Storage of current page using Chrome Extension Manifest Version 3
I'm migrating from manifest version 2 to version 3 and one of the functions I used to have to access the local storage of the current page was using this script:
chrome.tabs.executeScript({code:'JSON....
-1
votes
2
answers
46
views
How do I make a website save what we type into an input box using localStorage?
So here’s the concept:
I’m making a simple website where there’s an input box, and the website will save what we type onto localStorage, and show it up onto the website body. We can change the text in ...
0
votes
1
answer
37
views
How to render components based on localStorage value
How do I render based on the data in the localStorage? The localStorage has a key-value pair (location: US or Location: AU) and is added when the user visits.
import React, { useEffect, useState} from ...
0
votes
1
answer
29
views
Flutter Local Storage: FileSystemException
FileSystemException: An async operation is currently pending, path = '/data/user/0/com.example.ride/app_flutter/localstorage
final LocalStorage storage = LocalStorage('localstorage_app');
storage....
0
votes
2
answers
59
views
How to display local storage to HTML page?
I have a project. It is about to people search something in search page and when they come back to home page, searching history will show on home page. I have pushed searching data to local storage, ...
0
votes
1
answer
25
views
How do I get button to save to console
<div class="card content-return">
<div class="card-image image">
<button id="favoriteBtn">Save2Favorites</button>
javascriptenter image description here
I’m a beginner ...
0
votes
1
answer
19
views
Difference between Storage Space Direct and Azure Stack HCL
Microsoft technology changes so fast that I a falling behind. Hope someone here lights on the subject of hyper converge.
I was working of the technology to create a cluster using software technology ...
0
votes
0
answers
12
views
Redux-Persist works on all routes/pages/refreshes except for one route/page/refresh on my react project
In my shopping website project, I have successfully implemented redux with redux-toolkit and am using redux-persist to save the user and cart-items data to storage.
Everything works fine except for a ...
1
vote
1
answer
38
views
I want to prevent the localstorage from clear my objects on reload and adding new entries in my form
How do I prevent the local storage from being deleted after reload and insert a new entry from my input fields? I want to display the data that I saved in a list in HTML.
// when I add new items ...
0
votes
1
answer
21
views
I want to get a form and save it in local storage, but how?
Heyy,
i'm a beginner in writing with java script and i'm trying to copy Instagram, soo I need help in form and validation stuff and I also want to save it with local Storage.
I can't find the Problem ...
1
vote
1
answer
120
views
Clear tokens in Local Storage when all tabs or Browser is closed in React
I want to remove the user Authentication when the application has been loaded in multiple tabs. Once all the tabs that had the application loaded are closed or the entire browser is closed, I want to ...
0
votes
0
answers
11
views
React Local Storage adding an objects that persist [closed]
I am working on some movie app in react js.
I want to make it like my favorite page. So, when I click ADD to favorite on some movie, it should be stored somewhere, and when I refresh the page it ...
-1
votes
1
answer
55
views
Onclick function changes value
I want an easy way to set a variable value equal to n when function(n) runs.
<a href="products.html" onclick="loadProdType(0)">Hovedkort</a>
<a href="products....
0
votes
0
answers
9
views
Update the options in ChartJS permanently
I added a darkmode function to my website but the problem is the font color of options.title not permanently changing. Changing color when the darkmode is on/off is working but when refresh the page, ...
0
votes
1
answer
30
views
React toggle theme and save it to localStorage and also toggling classes to the html body tag
Please take a look at my code the toggle button is working completely fine but I also want to save the toggle state to localStorage I have tried it so many times before especially with Vanilla JS but ...
0
votes
0
answers
20
views
How to remove an item from Local Storage when clicking on it? [duplicate]
I want to delete an item stored in Local Storage when it is clicked. But I don't know how to do that. Please help me to solve this problem. Thanks a lot!!
the code right here:
const cartSlice = ...
0
votes
0
answers
19
views
How to fix 'The previous state received by the reducer...'?
I load/update data in localStorage:
import thunk from "redux-thunk";
import {applyMiddleware, createStore} from "redux";
import {composeWithDevTools} from "redux-devtools-...
0
votes
1
answer
34
views
how to change folder location to save file - DJANGO FileSystemStorage
so i want when i upload a file, the file will go to media/mp3 not media/txt. how to change save file location?
views.py:
def homepage(request):
if request.method == "POST":
form = ...
1
vote
1
answer
33
views
how to make custom form without database - DJANGO
So i want to upload file but only sent to locals storage NOT DATABASE too. But i don't know how to make custom forms.
suddenly, here's my models.py :
from django.db import models
class Audio_store(...
1
vote
1
answer
33
views
Why is localStorage getting cleared whenever I refresh the page?
Like the title says, the localStorage I set registers the changes made to the todoList array and JSON.stringifys it; however, whenever I refresh the page the array returns to the default [] state.
...
0
votes
0
answers
22
views
Async storage cannot retrieve data from react native
I am using AsyncStorage to keep user data to phone. After registering the user, i am trying to retrieve the user if exist one and automate redirect to profile page.
but I have problems with async ...
0
votes
1
answer
27
views
LocalStorage JS - is it safe to store data to keep persistent after refreshing the page?
Question if I store something that is not related to the user but more for displaying some data and keeping them persistent. is it still unsafe?
For example, I have some suggested locations and each ...
0
votes
1
answer
32
views
React useState doesnt update from localstorage
When i try to use setTodos(storedTodos) it just resets the array. if i replace the const [todos, setTodos] = useState([]); with const [todos, setTodos] = useState(JSON.parse(localStorage.getItem('...
0
votes
1
answer
23
views
Appwrite Local Storage Session Issue
Appwrite is installed in the subdomain. While the site is working in the main domain, it does not save session to localstorage when I login. But if I run it in a different domain, the problem is ...
0
votes
2
answers
46
views
localStorage data keeps resetting on page reload - React js
Error: localStorage data keeps resetting on page reload. Despite of being updated to localStorage before.
If I add new todo item, it is added to localStorage. But the updated items disappears after ...
1
vote
0
answers
25
views
Where is localStorage object is defined? [duplicate]
Where the browser localStorage variable defined and how is that possible we can access window.localStorage object through a global browser variable localStorage?Seems like this browser behaviour is ...
0
votes
2
answers
71
views
How to use localStorage on server side in node.js?
I'm trying to access Browser localStorage from the server side. I have tried it using node-localStorage, store and store2 node libraries but nothing worked. When I checked the browser localStorage it ...
0
votes
0
answers
26
views
Pass data from file js to other using localStorage
I have in the first file.js
map.on(L.Draw.Event.CREATED, function (e) {
drawnItems.addLayer(e.layer);
var collection = drawnItems.toGeoJSON();
localStorage.setItem('gameStorage', JSON.stringify(...
-1
votes
0
answers
23
views
localStorage add/remove addClass() to data-*attribute on element based on selected radio [please see the code bellow]
I need to change addClass() to attr() that can add data-*attribute on body tag substitute for addClass().
This code can not store multiple class stores in multiple instances
I need to add data-*attr() ...
0
votes
2
answers
55
views
Save multiple radios checked on LocalStorage
I have a list of multiple radios and I would like to save which radios are checked in localStorage when the user clicks a button.
Once the user reloads (or comes back on) the page, I would like to ...
0
votes
0
answers
27
views
How to display record roll and attempts same time?
I got this little dice game and i display roll attempts at each game session but i also want to display "record score", which will be in local storage. how could i make that?
const [...
0
votes
1
answer
29
views
How to update data between tabs using Svelte Store
I'm creating a Store in Svelte that subscribes to value changes and stores the value on localStorage.
When opening the page there is an input tag with the value binded to the store. Everything works ...
0
votes
0
answers
32
views
Access localStorage of chrome extension in background script
I need to access the localStorage of a chrome extension in background.js to get values which have been set by the extension popup itself. The key-value pair is existing, I checked that by inspecting ...
1
vote
1
answer
83
views
React.StrictMode seems to work differently in different React version (18.1.0 vs 17.0.1)
Let me tell you in brief what I am trying to do. As I am learning React, so following a tutorial and making a Contact Manager, where it will take input of name and email address for now and will save ...
0
votes
0
answers
17
views
Same code in terms of localStorage worked in React 17, but doesn't work in React 18 [duplicate]
const [count, setCount] = useState(0);
useEffect(() => {
const savedCount = JSON.parse(localStorage.getItem("count"));
setCount(savedCount);
}, []);
useEffect(() => {
...
0
votes
2
answers
44
views
Check duplicate value in localstorage
I want to check if a id exist in database it will just simply replace it. When i try to do that it is adding the same id.
addEntry = (e,id) => {
e.preventDefault()
let product_list = []
...
0
votes
0
answers
11
views
Difference between "useState(() => JSON.parse(localStorage.getItem("count")));" and useState(JSON.parse(localStorage.getItem("count"))); [duplicate]
//store the count in the localStorage
// get the value from localStorage and set initial value to the count
// Solution one: JSON.parse will be called every single render
const [count, setCount] = ...
0
votes
1
answer
36
views
Where is the user data stored after decoding it from the token?
Where is the user data stored after decoding it from the token? I'm using react , and the Jwt token is stored in local-storage .
0
votes
1
answer
31
views
How to replace a value in localstorage using javascript?
If the value is exist in localstorage I want to replace it. When I try to do that existing value is still inserting.
addEntry = (e,id) => {
e.preventDefault()
let product_list = []
let ...
0
votes
1
answer
63
views
Why React state in localStorage is being deleted
I'm having problems to persist the state in the local storage. It's a simple todo app. After adding one todo and refreshing it, all todos are being deleted. Could not figure out why. Here is the ...