December 2015
Intermediate to advanced
144 pages
3h 37m
English
The first feature in the new dashboard is to display a real-time list of earthquakes, including information about their locations, magnitudes, and dates. The data for this list is the same as for the map, which comes from the USGS website. We’ll first create a function that returns a row element given a props object parameter:
| | function makeRow(props) { |
| | var row = document.createElement('tr'); |
| | row.id = props.net + props.code; |
| | |
| | var date = new Date(props.time); |
| | var time = date.toString(); |
| | [props.place, props.mag, time].forEach(function(text) { |
| | var cell = document.createElement('td'); |
| | cell.textContent = text; |
| | row.appendChild(cell); |
| | }); |
| | |
| | return |
Read now
Unlock full access