Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Single Page App - Local Storage using AmplifyJS
<!DOCTYPE html>
<html xmlns="">
<title>Persist on Local Store</title>
<h3>Save My Name</h3>
<label for='firstName'>First Name:</label>
<div class='input'><input type='text' id='firstName' /></div>
<label for='lastName'>Last Name:</label>
<div class='input'><input type='text' id='lastName' /></div>
<input id="storeMe" type="button" value="Store" />
<script src="Scripts/jquery-1.4.4.js"></script>
<script src="Scripts/amplify.js"></script>
var myName = { firstName: "", lastName: "" };
$(function () {
aName ="name");
if (typeof aName !== 'undefined') {
myName = aName;
$("#firstName").attr("placeholder", myName.firstName);
$("#lastName").attr("placeholder", myName.lastName);
} else {
$("#storeMe").click(function () {
myName.firstName = $("#firstName").val();
myName.lastName = $("#lastName").val();"name", myName);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment