Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9b34da0

Browse files
committed
updated homework week5
1 parent ec5d7fd commit 9b34da0

File tree

4 files changed

+30
-31
lines changed

4 files changed

+30
-31
lines changed

Week3/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ In week four we will discuss the following topics:
1515

1616
- [JSON](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON) (MDN)
1717
- In you next lecture **Unmesh** will give you your first Git session, please look through the [GIT](https://github.com/HackYourFuture/Gitrepository) and read the learning goals.
18+
- Chrome DevTools [Debugging](https://developers.google.com/web/tools/chrome-devtools/?utm_source=dcc&utm_medium=redirect&utm_campaign=2016q3)
1819

1920
### A Refresher from some previous covered topics:
2021

Week5/MAKEME.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,30 @@ If you are confused please run the code and then consult the Google for "javaScr
8787
### Step 2: Feedback
8888
Give feedback on step 2 of the homework to one of your fellow classmates.
8989
90-
### Step 3: continue your Custom challenge :boom:
90+
### Step 3: Homework for JavaScript
91+
92+
Make a website that fetches (= to get) data asynchronously.
93+
94+
1) Create a new website with external js file
95+
96+
2) Add a button (e.g. 'click me') that when clicked `console.logs` 'you clicked me!'
97+
98+
3) Create a function that fetches from [this weather API](https://openweathermap.org/current). For example from [this page] (http://samples.openweathermap.org/data/2.5/weather?q=London,uk&appid=b1b15e88fa797225412429c1c50c122a1). For help on this check this [SO post](https://stackoverflow.com/questions/247483/http-get-request-in-javascript)
99+
100+
4) Display the data that you get from the weather API on your web page.
101+
102+
5) Now link the two together: When you click the button -> get the data from the weather API and display it on your website
103+
104+
6) BONUS: if you look at this:
105+
106+
```
107+
http://samples.openweathermap.org/data/2.5/weather?q=London,uk&appid=b1b15e88fa797225412429c1c50c122a1
108+
```
109+
110+
you can see `?q=London,uk` in the URL. These are called "query parameters" and let us specify in detail what we want from the API. Play around with this. For example you can make two buttons that either get data for London or Amsterdam. Or go even more crazy and make users type in a search box 'amsterdam' and then send that to the API by changing the location.
111+
112+
91113
92-
We are going to continue our github-repo page from last week.
93114
<!--
94115
1. For each repository, show (in the right column) who the contributers are. You will need to use the `contributors_url` for this.
95116
2. Make all the repositories link their own page in Github. Use the value of the key: `name` to make this work (hint: Github urls always look like this https://api.github.com/repos/HackYourFuture/[repositoryName] where [repositoryName] would be replaced by the actual `name` of the repository, for example `CommandLine`). Make sure the link opens in a new tab.

Week5/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ In week six we will discuss the following topics:
1616
- [Polling](https://davidwalsh.name/javascript-polling)
1717
- [JavaScript Variable Scope and Hoisting Explained](http://javascriptissexy.com/javascript-variable-scope-and-hoisting-explained/)
1818

19-
This Sunday we have a test :boom:
19+
### This Sunday we have a test :boom:
2020
If you feel you need preparation for the test we recommend to do the following:
21-
• Take a look at the topics listed in the [README](https://github.com/HackYourFuture) of this repo (up to and including week 5).
22-
• Review all the _REVIEW.md_ files in every week.
23-
• Look up the concepts you are struggling with in your __Smarter Way to Learn JavaScript__ book :books:.
24-
• It's also useful to go through the reading material and homework of the last weeks.
21+
22+
- Take a look at the topics listed in the [README](https://github.com/HackYourFuture) of this repo (up to and including week 5).
23+
- Review all the _REVIEW.md_ files in every week.
24+
- Look up the concepts you are struggling with in your __Smarter Way to Learn JavaScript__ book :books:.
25+
- It's also useful to go through the reading material and homework of the last weeks.
2526

2627

2728
_Please go through the material and come to class prepared!_

Week6/MAKEME.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,27 +43,3 @@ How to hand in your homework:
4343
• Your hyf-javascript2/week3 should now contain an index.html, main.css and a script.js file (and the images folder)
4444
• Place the link to your repository folder in Trello.
4545
```
46-
47-
48-
## Homework for JavaScript
49-
Make a website that fetches (= to get) data asynchronously.
50-
51-
1) Create a new website with external js file
52-
53-
2) Add a button (e.g. 'click me') that when clicked `console.logs` 'you clicked me!'
54-
55-
3) Create a function that fetches from [this weather API](https://openweathermap.org/current). For example from [this page] (http://samples.openweathermap.org/data/2.5/weather?q=London,uk&appid=b1b15e88fa797225412429c1c50c122a1). For help on this check this [SO post](https://stackoverflow.com/questions/247483/http-get-request-in-javascript)
56-
57-
4) Display the data that you get from the weather API on your web page.
58-
59-
5) Now link the two together: When you click the button -> get the data from the weather API and display it on your website
60-
61-
6) BONUS: if you look at this:
62-
63-
```
64-
http://samples.openweathermap.org/data/2.5/weather?q=London,uk&appid=b1b15e88fa797225412429c1c50c122a1
65-
```
66-
67-
you can see `?q=London,uk` in the URL. These are called "query parameters" and let us specify in detail what we want from the API. Play around with this. For example you can make two buttons that either get data for London or Amsterdam. Or go even more crazy and make users type in a search box 'amsterdam' and then send that to the API by changing the location.
68-
69-

0 commit comments

Comments
 (0)