Skip to content

Commit 1a10367

Browse files
committed
Tweak week 1 exercise
1 parent 4589537 commit 1a10367

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎src/week1/exercise/app.js‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
xhr.send();
1010
}
1111

12+
function handleChangeCategory(category) {
13+
const url = `http://api.nobelprize.org/v1/prize.json?category=${category}`;
14+
console.log('url', url);
15+
}
16+
1217
function main() {
1318
const select = document.getElementById('select-category');
14-
const ul = document.getElementById('prize-list-container');
15-
16-
select.addEventListener('change', () => {
17-
const url = `http://api.nobelprize.org/v1/prize.json?category=${select.value}`;
18-
console.log('url', url);
19-
});
19+
select.addEventListener('change', () => handleChangeCategory(select.value));
2020
}
2121

2222
window.onload = main;

0 commit comments

Comments
 (0)