// Generator, by Geoff $(document).ready(function(){ $(".clickSay").click(function( event ){ var textToSay = $(this).text(); responsiveVoice.speak(textToSay); }); $.getJSON("lessons.json", function(data) { var wordsHtml = ''; var sidebarHtml = ''; var lessonIndex = 0; $.each(data, function(lesson, wordList){ lessonIndex++; $.each(wordList, function(key, word){ wordsHtml += ' '; }); sidebarHtml += '
  • '+ lesson +'
  • '; }); $('#words').html(wordsHtml); $('#lessonIndex').html(sidebarHtml); swapView(1) }); }); function swapView(newView){ $(".lesson").hide(1000); $(".lesson-" + newView).show(1000); }