Permalink
Browse files

added a menu.json file that has the current book menu

  • Loading branch information...
1 parent 5a26479 commit 91735a155ed1244a9abdfe9b8bbbba2a09f6c26d Emerson Lackey committed Jan 7, 2011
Showing with 8 additions and 1 deletion.
  1. +1 −0 index.html
  2. +6 −1 js/app.js
  3. +1 −0 menu.json
View
@@ -34,6 +34,7 @@
<ul id="localstore-controls">
<li><a id="save" href="#">Save to Localstore</a></li>
<li><a id="clear" href="#">Clear Localstore</a></li>
+ <li><a id="load" href="#">Load from JSON</a></li>
</ul>
</div><!-- #top-menu -->
View
@@ -58,7 +58,12 @@ $(document).ready(function() {
});
$('#load').click(function() {
- MENU = JSON.parse(localStorage.getItem('menu'));
+ $.getJSON('menu.json', {}, function(data) {
+ localStorage.setItem('menu', JSON.stringify(data));
+ MENU = JSON.parse(localStorage.getItem('menu'));
+ paint_menu();
+ });
+
return false;
});
View
Oops, something went wrong.

0 comments on commit 91735a1

Please sign in to comment.