Counting fun - using local storage to save a NUMERIC value
I've spent this afternoon going round and round in circles.
I have a local storage variable called requestcount (set to a number, although from what I've read all numbers are stored as a string in local storage?)
So every time the user clicks a submit button I want to add 1 to the value of requestcount.
here's what I have that doesn't work:
var rc = parseInt(localStorage.getItem('requestcount'));
rc++;
localStorage.setItem('requestcount',rc)
Alert before moving to next page shows the correct incremental increase (say 3), however when I go to the next page and alert the localStorage variable I get 31???
So how does it work?