Created
June 23, 2010 02:07
-
-
Save bryanwb/449391 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>storage test w/ jstorage</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script src="http://github.com/andris9/jStorage/raw/master/jstorage.js"></script> | |
</head> | |
<body style="font: 75% Lucida Grande, Trebuchet MS"> | |
<div id="content"></div> | |
<p id="log" style="color: gray"></p> | |
<div> | |
<form> | |
<table> | |
<tr> | |
<td>key</td> | |
<td><input id="inputKey" type="text"></td> | |
<td>value</td> | |
<td><input id="inputVal" type="text"></td> | |
<td><a id="add" href="#">ADD</a></td> | |
</tr> | |
<tr> | |
<td>key</td> | |
<td><input id="getKey" type="text"></td> | |
<td>value</td> | |
<td id="val"></td> | |
<td><a id="get" href="#">GET</a></td> | |
</tr> | |
</table> | |
</form> | |
</div> | |
<script> | |
$("#add").bind('click', function(){ | |
var key = $("#inputKey").attr('value'); | |
var value = $("#inputVal").attr('value'); | |
$.jStorage.set(key, value); | |
}); | |
$("#get").bind('click', function(){ | |
var key = $("#getKey").attr('value'); | |
$("#val").html($.jStorage.get(key)); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment