Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

119
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!