Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

118
Visualizações
My clicker game is saving, but when I try to load It displays everything as the starting number

So I'm working on a save feature for my clicker game (for context the clicker game is about making limes) and it saves and loads my Limes And Clickers, but it doesn't display my current clickers and the current clicker cost, instead it is displaying 0 clickers and the original clicker cost (0). I haven't really tried anything different cause im not sure what i would try but here is my code (JavaScript and HTML).


function save() {
    localStorage.setItem('ones', JSON.stringify(ones));
}

function load() {  
    ones = JSON.parse(localStorage.getItem('ones'));
  }

________________________________________________________

<button onclick="save()">Save</button>
<button onclick="load()">Load</button>

<button onclick="buyClicker()">Buy Clicker</button>
<p>Clickers: <span id="Clickers">0</span></p>
<p>Clicker Cost: <span id="ClickerCost">10</span></p>



about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You are loading the saved data, but you are not updating the DOM. It would help if you considered manually changing the innerHTML of "Clickers" and "ClickerCost" by your script.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda