Skip to content

Instantly share code, notes, and snippets.

@cgcardona
Created August 29, 2010 09:59
Show Gist options
  • Save cgcardona/556165 to your computer and use it in GitHub Desktop.
Save cgcardona/556165 to your computer and use it in GitHub Desktop.
function doSetItem() {
// get the lat, lon, and epoch ready for storage
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}
localStorage.setItem(epoch, storageLocationObject)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment