Demonstration Javascript to store current position in local storage