mlb-getjson.html. Get MLB teams with jQuery .getJSON method. Note that there are two "buildList" functions given -- buildList uses the standard DOM methods to build up the content; buildListJq uses jQuery syntax to build up the DOM and content; both functions result in the same output and use the same data.
National Park Service
nps-1.html. Here the main features are using Mustache template for the content, plus an XHR request to a static JSON data file.
nps-2.html. Here we have a text input for the user to type in a state code (e.g. CA, MA, PA, KS), and the JSON data source is a URL from NPS. The URL contains the stateCode and api_key parameters in the query string.
nps-3.html. Here, the functionality is the same as in nps-2.html, except we are accomplishing it with the jQuery library.
nps-4.html. Here, we work with a list of states (from a static JSON file) to build the select option menu. In addition, the history and URL are manipulated so that each "view" has a unique URL that could be shared.
nps-map.html. We take nps-4.html and instead of displaying park content in HTML, we place markers on a map, using LeafletJS and Open Street Maps.
Form
form-1.html. Comment form that uses the submit.php server side script
form-2.html. Comment form that is submitted by JavaScript and keeps user on same page