Most voted "localstorage" questions
The Localstorage object stores data locally and makes it available to any window/tab. Data in Localstorage is maintained even if the browser is closed, which is removed only by the application that defined it, or manually by the user.
Learn more…122 questions
Sort by count of
-
47
votes3
answers12057
viewsDifferences between localStorage Vs sessionStorage?
What are the differences, pros and cons between localStorage and sessionStorage?
-
9
votes1
answer1403
viewsSave image link as file in Storage location
How can I save a link (http://example.com/img.png) in the file format, which in this case is . png, using Javascript and saving in the local $localStorage angularjs?…
-
9
votes3
answers7003
viewsHow to make Local Storage expire?
I have a certain scenario in which I need the user to stay login and stay connected for some time. However, if inactivity is detected on the page after a while, maybe 20 min, expire the Local…
-
9
votes1
answer390
viewsWhat is the difference between Local Storage, Indexeddb and Websql?
I have a habit of using Local Storage to store JWT, I would like to know the difference between Local Storage, Indexeddb and Websql and when to use one or the other.
-
8
votes1
answer348
viewsCollapse Menu after page refresh with localStorage
How can I close a menu and keep it closed after the refresh of the page using jQuery only? It would be something like at this link. By clicking the button the menu is reduced and remains so even…
-
7
votes1
answer8172
viewsHow to catch setar/catch object in localstorage?
I’m sending a JSON object to localStorage: window.localStorage.setItem('tarefa',aux); And I try to get this object in another controller like this:…
-
6
votes4
answers1904
viewsHow to control when localstorage data expires?
I’m storing some data on localstorage browser and would like to set an expiration date for that data, but I do not find a way to control when these data expire. These data have some control over…
-
5
votes1
answer3871
viewsLocal Storage or Cookie, where is it best to store an authorization token?
We have a project and we will use a token de autorização, we’re using AngularJs to the front end and the back we develop in Java using Spring Framework and Spring Security, and send the token for…
-
5
votes2
answers462
viewsHow to recover an array saved on localStorage
var pessoa = ["Bonito","Alto","Magro"]; Window.localStorage.setItem('pessoa',JSON.stringify(pessoa)) pessoa=[null] Now I want to recover that value Bonito,Alto,Magro one by one , which is no longer…
-
5
votes4
answers330
viewsCreate "dark" function on the site!
I am developing a website and wanted to implement that famous "dark" function so that the user can choose. Searching and mining our dear internet, I managed to have a certain result, I created the…
-
5
votes3
answers204
viewsIs it possible to save a used browser object localstorage?
I made a Todo list with 3 features: add an item, delete and clean the input field. I would like the added items to be saved after reloading the page, it is possible to do this using the…
-
4
votes2
answers4666
viewsRemove disabled attribute when a condition is met
Good night. I am trying to make a login and registration screen for an application that will save the data in localStorage. To prevent the user from registering with incomplete data I disabled the…
javascript jquery html5 localstorage javascript-eventsasked 7 years, 7 months ago Mauricio Hartmann 131 -
4
votes3
answers10794
viewsstore an array of objects in a Storage location with JS
I’m a little layy with Javascript and I’m trying to create a array of objects to save data from a form with the localStorage, but I don’t know how to do it. I already created the code to store the…
-
3
votes1
answer1363
viewsIs there a way in ASP.Net MVC, in the controller to access a variable in sessionstorage or localstorage?
I need to get the value of a variable stored in sessionstorage through a controller where this method is not passed the parameter of this variable. Session/localstorage are managed through…
-
3
votes1
answer1779
viewsCalculate online time with Javascript/jQuery
I need to develop a code where I don’t have access to languages back-end, need to do a function that calculates the time a user is online on the page and save this time on localStorage, I thought…
-
3
votes1
answer2211
viewsDoes Localstorage have any storage limits?
I need to store a very large amount of words/phrases in the user’s browser, I would like to know if use localStorage is a good option. If yes, there is some restriction/limit on the amount of…
-
3
votes2
answers581
viewsUse Cookie or Localstorage?
I was developing a plugin for jQuery and needed to store some information. I thought I’d use the localStorage of HTML5, but I was warned by a friend that in some older versions of browsers would not…
-
3
votes1
answer470
viewsrecover localstorage array and turn into a sql query in php
I am developing a feature to add and remove favorite properties with localstorage. //Com esse código eu recupero os itens que foram armazenados em um array no localstorage $(function(){ var…
-
3
votes0
answers1140
viewsWhat is the difference between Local Storage, Session Storage and Cookie?
What’s the difference between Local Storage, Session Storage and Cookie? What is the purpose of each of them and what differentiates them?
-
3
votes1
answer1168
viewsHow to pass headers on request with Vue.js 2
I need to pass the header Authorization which is located in the localStorage with the key to iflix-user-token, here is my code: getFilmes: function () { this.$http.get(Api.url + '/filme').then(…
-
3
votes1
answer168
viewsAccess token storages (JWT token)
I am facing the need to store the access token of a user who logged in through a method with Oauth2, this JWT token will be used for my frontend application, written in React, make calls to an API…
-
2
votes5
answers801
viewsIs it possible to upload files without using PHP?
I have to make a video upload system, at first, without using the "server side". I wonder if you can do this without php, using Sqllite or Local Storage. I’ve researched several sites and I haven’t…
-
2
votes1
answer189
viewsProblems with Phonegap and HTML5 Storage
I am creating a small application where I have to store the recovered driver data from a proprietary API to the application’s local database. After a lot of head-breaking, I chose to use HTML5…
-
2
votes1
answer833
viewsConfusions with JSON.stringify, JSON.parse and OBJECT.push()
Well I’m cluttering up with these commands, in fact what I’m wanting to do is the following. Using localStorage maintain a database. NOME TABELA | DADOS TABELA tbl_TESTE | {teste 01, teste02,…
-
2
votes1
answer4806
viewsLogin with angular 4
I am learning angular4, and would like to know a way to login with the same. I can already get the backend data, but how do I set up the session? (I came from php, there was only use). I saw…
-
2
votes2
answers347
viewsLocal Storage - Always replaces last data
I have this code: var ClienteArray = []; $('#btn-save').click(function(){ var cliente = JSON.stringify({ Code : $('#stn-code').attr('value'), Name : $('#stn-name').attr('value') });…
-
2
votes1
answer111
viewsReturn JSON saved in localStorage
I am trying to recover a JSON that I saved in localStorage, in function salvarOffline(). With the code as is the function listarHorarios() I get a undefined and the loop loop does not work. My code:…
-
2
votes1
answer354
viewsSave checked checkboxes and load them when page reloads
I would like the checkboxes that have been marked to be saved and loaded whenever the page is reloaded or opened again, in addition, in their place there will be icons referring to the options. I…
-
2
votes2
answers58
viewsExchange array data between’S' and 'N'
I have a function that I will adapt to a button, which will exchange a data within an array, between S and N. The code I have is: var array =…
-
2
votes2
answers620
viewslocalStorage save some fields
Speak guys, I have a problem, as I use "localStorage" to save some fields of my form. <script> var entrada = document.getElementById('rua'); var entrada2 = document.getElementById('bairro');…
-
1
votes1
answer1028
viewsLooping Loops with Angularjs
I’m trying to list the two-loop data ng-repeat of my code, but 1 of them is not working. In case I’m using: <ul class="nav nav-stacked nav-pills col-md-2" > <li ng-repeat="g in…
-
1
votes1
answer234
viewsJavascript: Master Tab
I need a certain function in a project, I need some functions only run in a tab of my site, for example... The user is in the tab HOME but the flaps SOBRE, CONTATO are open and on this site plays an…
-
1
votes1
answer1289
viewsHow to read and write JSON locally in Cordova?
I need a simple solution to persistently upload and update data in a mobile APP using Cordova. I thought I’d create a JSON in the application root folder to load the data on APP startup. Even for…
-
1
votes1
answer438
viewsDatabase loca + Node.js
I am working on a project using Node.js. I need to use a local database, but I wanted to reconcile performance with security, and if possible, portability as well. I only know MS Access (.accdb) and…
-
1
votes0
answers140
viewsHow to implement Favorites on localStorage?
I’m implementing a notification control project. On the page where you list notifications, there is a star in each notification to add it to your favorites, which is stored in the localStorage.…
-
1
votes1
answer359
viewsHow to write data to the webstorage without overwriting already recorded data?
I created a form and when the user fills this form the data is sent to the local webstorage and from there to a table. However, whenever you write a data in localstorage the previous data is…
-
1
votes1
answer5498
viewsStore and retrieve variable containing HTML list using localStorage
I have a project and I’m using localStorage as a database. I use this to save a list that the user can edit and add like this: localStorage.setItem(local, $("#lista").html()); In html it looks like…
-
1
votes1
answer335
viewsRecover localStorage data in your particular input!
I have a code that dynamically registers input data in the localStorage. I am trying to recover the data registered in their respective inputs, but without success. This is the code to recover the…
-
1
votes1
answer452
viewsSearch in the localStorage
Well I need to do a search in the localStorage, and in this I need to know which start item with a certain character, for example: Quero pegar todos as key que começão com pes_ ou seja no exemplo…
-
1
votes2
answers250
viewsHow can I receive names via a text field in an HTML page and save them to an array in the browser’s Local Storage?
I need help finishing function logic: <form name="form1" onsubmit="submeter()"> Nome: <input type="text" id="nome" value="" onkeyup="validarNome()"/><br/><br/> Idade:…
-
1
votes1
answer595
viewsHow to display a menu according to the type of user logged in with Ionic / Angularjs?
Hello, I have two types of users: buyer and seller. How to display a menu according to the type of user logged in with Ionic / Angularjs? Currently, and does not work well, I am putting on each menu…
-
1
votes1
answer70
viewsConvert Json to Long type
I have a Json object coming from localStorage and I need it to be converted to a Long type, in case entidadeId idEntidade = localStorage.getItem("idEntidade"); var entidadeId =…
-
1
votes1
answer938
viewsShow data from localstorage
I created a code that stores the data in the localstorage, but now I need that data that is in the localstorage to appear on the screen. So I want to know how I can do this. (Note: I am developing a…
-
1
votes1
answer122
viewsGood Practices for Moving JSON Object
I have a grid (Kendo ui MVC) today has 35163 lines, and I need to create a button to export the contents of the grid to CSV. I thought I would do something like this, the moment I load the…
-
1
votes2
answers653
viewsAdd object in Localstorage [Object Object]
I have added an object to LocalStorage as follows: user: { authenticated: false, email: '', id: '', cpf: '' } localStorage.setItem('userData', this.user) When will I recover,…
-
1
votes1
answer868
viewsHow to apply sessionStorage or localStorage in code
I’m using the following code: <script type="text/javascript"> $(window).scroll(function() { if ($(this).scrollTop() > 300){ $('.float-menu-fixed').removeClass("closed");…
-
1
votes2
answers483
viewsProblem saving information to localstorage via js
Guys I’m trying to save my timer in the local storage but it is not saving it when I enter my console it does not appear follow my code HTML and JS html <div id="timer"> <span…
-
1
votes1
answer117
viewsSave to localStorage the position to hold it when reloading the page
When the user clicks on a given button the scroll position of an element is changed. I would like this action to be stored in Localstorage, but I do not know... can help me? Here my script:…
-
1
votes0
answers120
viewsAngularjs - Json in Localstorage does not update Array
I have a form in a View that should update the "color" property of an Array. This Array colors has 5 objects, each serving to set the color of an element of another View (so the option to use…
-
1
votes2
answers1370
viewsHow to keep selected checkbox after refresh on page with localstorage JS
I’m trying to keep the checkbox selected even after refreshing on the page, this is my progress: // javascript var s_item = ""; function save(items) { s_item = items; var checkbox =…