Questions tagged as 'localstorage'

2
answers

I can not work with localStorage

I have the following javascript code: const player1 = "X"; const player2 = "O"; var playTime = player1; var gameOver = false; var pontuacaoX = 0; var pontuacaoO = 0; var chaveX = 'scoreX'; var chaveO = 'scoreO'; var valAcumuladoX = 0; atualiz...
asked by 22.08.2018 / 19:29
2
answers

How to keep checkbox selected after refresh on page with localstorage JS

I'm trying to keep the checkboxes selected even after refresh on the page, this is my progress: // javascript var s_item = ""; function save(items) { s_item = items; var checkbox = document.getElementById(s_item); localStorage.set...
asked by 14.01.2018 / 17:07
0
answers

AngularJS - 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 contains 5 objects, each one serving to set the color of an element of another View (so the option to use localStorage, since I can not use any access to the...
asked by 09.10.2017 / 14:06
1
answer

If else if in Javascript

I'm developing an application using phonegap / cord which stores data using localStorage and I'm having a problem in javascript ... I'm calling a function to save () my data, a function to load () and a rank () function. I am checking the local...
asked by 19.09.2016 / 02:36
0
answers

How to deploy Favorites in localStorage?

I'm implementing a notification tracking project. On the page where you list notifications, there's a star on each notification to add it to bookmarks, which is stored in localStorage . However, I'm not able to program jQuery to receive cl...
asked by 07.01.2016 / 22:50
1
answer

Share LocalStorage with browsers

Is there any way to share localstorage with multiple browsers? For example, I set localStorage.setItem("lang", "pt"); in Chrome, however, I would like this value to be available in Firefox and other browsers that support LocalStorage....
asked by 01.09.2017 / 15:41
1
answer

Error trying to use HTML5 Local Storage

I am studying about local storage in HTML5 and JS, understanding that its purpose is to store texts in local / p> When testing, I got JS errors. I would like to understand why: <scripttype="text/javascript"> function exibir(){...
asked by 23.09.2014 / 19:37
1
answer

Change site style / theme and store it in LocalStorage

I have a theme change system in my blog, however it has some problems, like, it can not change the style of a div.class added by jquery (addClass) or pseudo elements (after / before / active etc ) and it gets all disorganized !! I'm looking f...
asked by 04.12.2018 / 05:50
1
answer

Show localstorage data

I created a code that stores the data in the localstorage, but now I need the data that is in the localstorage to appear on the screen. So I want to know how I can do this. (Note: I'm developing a form) (html) <button id=""cadastro" oncl...
asked by 13.03.2018 / 20:24
1
answer

Help on how to use setItem and getItem of localStorage

I'm trying to save an answer, but I can not, every time I refresh the previous answer back. Here's what I'm trying to implement: <!DOCTYPE html> <html lang="pt-BR"> <head> <meta charset="utf-8"> <...
asked by 01.08.2018 / 17:59