Created
August 29, 2010 10:32
-
-
Save cgcardona/556190 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doSetItem() { | |
// get the lat and lon ready assigned to variables | |
var lat = $("#lat").text() | |
var lon = $("#lon").text() | |
var datestamp = new Date() | |
var epoch = datestamp.getTime() | |
// create the JSON for the database | |
var storageLocationObject = {"lat": lat, "lon": lon} | |
// serialize the object into a string | |
var stringyObject = JSON.stringify(storageLocationObject) | |
localStorage.setItem(epoch, stringyObject) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment