|
3 | 3 | ``` |
4 | 4 | In week one we will discuss the following topics: |
5 | 5 | • Structure for a basic SPA (Single Page Application) |
6 | | -• XMLHttpRequests |
| 6 | +• AJAX & XMLHttpRequests |
7 | 7 | • API calls |
8 | 8 | ``` |
9 | 9 |
|
10 | 10 | Here are resources that we like you to read as a preparation for the first lecture: |
11 | 11 |
|
12 | | -### Fundamentals |
| 12 | +## 1. DOM manipulation |
13 | 13 |
|
14 | | -- [XMLHttpRequest](../../../../fundamentals/blob/master/fundamentals/XMLHttpRequest.md) |
| 14 | +To refresh your DOM manipulation skills, watch this YouTube video series from Traversy Media: |
15 | 15 |
|
16 | | -### APIs |
| 16 | +- [JavaScript DOM Crash Course](https://youtu.be/0ik6X4DJKCc). |
17 | 17 |
|
18 | | -- Read about APIS: https://www.programmableweb.com/api-university/what-are-apis-and-how-do-they-work |
19 | | -- Traversy Media (YouTube, 18 mins): [What Is A RESTful API? Explanation of REST & HTTP](https://youtu.be/Q-BpqyOT3a8). |
| 18 | +You will be using these particular DOM manipulation methods and properties in the JS3 homework for the next three weeks: |
20 | 19 |
|
21 | | -### AJAX & XMLHttpRequests |
| 20 | +#### Course Video Part 1 (39 mins): |
| 21 | + |
| 22 | +- `document.getElementById()` |
| 23 | +- `element.textContent` |
| 24 | + |
| 25 | +#### Course Video Part 2 (21 mins): |
| 26 | + |
| 27 | +- `document.createElement()` |
| 28 | +- `element.setAttribute()` |
| 29 | +- `element.appendChild()` |
| 30 | + |
| 31 | +#### Course Video Part 3 (34 mins): |
| 32 | + |
| 33 | +- `change` event (`<select>` element) |
| 34 | +- `element.addEventListener()` |
| 35 | + |
| 36 | +Note that throughout the video lectures the presenter uses `var` to declare variables. We prefer that you use `const` and `let` instead in your homework. |
| 37 | + |
| 38 | +## 2. APIs |
| 39 | + |
| 40 | +In the homework we will be using the GitHub API. Learn about remote Web APIs in general from this YouTube video (18 min) from Traversy Media: |
| 41 | + |
| 42 | +- [What Is A RESTful API? Explanation of REST & HTTP](https://youtu.be/Q-BpqyOT3a8). |
| 43 | + |
| 44 | +For more research, check out the following resources: |
| 45 | + |
| 46 | +- [What are APIs - series](https://www.youtube.com/watch?v=cpRcK4GS068&list=PLcgRuP1JhcBP8Kh0MC53GH_pxqfOhTVLa) |
| 47 | + |
| 48 | +## 3. AJAX & XMLHttpRequests |
| 49 | + |
| 50 | +Please watch the first 45 mins of the Ajax Crash Course (up until the PHP examples) by Traversy Media: |
| 51 | + |
| 52 | +- [Ajax Crash Course](https://youtu.be/82hnvUYY6QA) |
| 53 | + |
| 54 | +The example code in this course is using on ES5 syntax. In the **traversy_ajax_crash** folder in this repo you will find updated example code (**ajax1**...**ajax3**) that use the ES6 syntax and styling that we prefer in HYF. Specifically, the following changes have been made: |
| 55 | + |
| 56 | +1. The JavaScript code has been placed in a separate file, loaded with a `<script>` tag from the HTML file. |
| 57 | +2. Instead of **var** to declare a variable, **const** and **let** are used. |
| 58 | +3. The non-strict equality operator `==` has been replaced with the strict version `===`. |
| 59 | +4. Functions are defined before they are used. |
| 60 | +5. Anonymous functions use the arrow syntax instead of the **function** keyword. Consequently, the `this` value inside the **XMLHttpRequest** event handlers have been replaced with the `xhr` variable name. |
| 61 | +6. The `for...in` loops for iterating through an array have been replace with `for...of`. |
| 62 | + |
| 63 | +Read more about using **XMLHttpRequest**: |
22 | 64 |
|
23 | | -- Watch the [Ajax Crash Course](./ajaxcrash) (45 mins) from Traversy Media. |
24 | 65 | - [Making HTTP Requests in JavaScript](https://www.kirupa.com/html5/making_http_requests_js.htm) |
25 | 66 |
|
26 | 67 | ### Clean Code |
27 | 68 |
|
28 | | -- [How to write clean code? Lessons learnt from “The Clean Code” — Robert C. Martin](https://medium.com/mindorks/how-to-write-clean-code-lessons-learnt-from-the-clean-code-robert-c-martin-9ffc7aef870c). |
29 | | - |
30 | | - > Note that this article includes some code examples written in Java, but the same principles can equally be applied to JavaScript. |
| 69 | +- [How to write clean code? Lessons learnt from “The Clean Code” — Robert C. Martin](https://medium.com/mindorks/how-to-write-clean-code-lessons-learnt-from-the-clean-code-robert-c-martin-9ffc7aef870c). Note that this article includes some code examples written in Java, but the same principles can equally be applied to JavaScript. |
31 | 70 |
|
32 | 71 | - [Clean Code concepts adapted for JavaScript](https://github.com/ryanmcdermott/clean-code-javascript) |
33 | 72 |
|
34 | 73 | ### Handing in homework using GitHub pull requests |
35 | 74 |
|
36 | | -- [Handing in homework](https://github.com/HackYourFuture/fundamentals/blob/master/fundamentals/homework_pr.md) |
| 75 | +- HYF Fundamental - [Handing in homework](https://github.com/HackYourFuture/fundamentals/blob/master/fundamentals/homework_pr.md) |
0 commit comments