JavaScript, Part 3

Here are some examples with a bit of annotation that I hope are helpful to you in your JavaScript adventures!
— David

Creating Content with DOM and innerHTML Examples

Here, we get started by iterating through data structures, and using either DOM methods to create content or using "string" values for our content and using innerHTML to add those to the page.

Template Examples

{
    "apples" : [
                  "Granny Smith",
                  "Macoun",
                  "Empire",
                  "Honey Crisp",
                  "Albemarle Pippin"
                ],
    "oranges" : [
                  "Naval Orange",
                  "Tangelo",
                  "Clementine",
                  "Valencia Orange"
                ]
   }

Maps Examples

I'll focus on the use of LeafletJS and OpenStreetMap (OSM) tiles.