Conversation
| <header class="heading"> | ||
| <h1>THE END IS NIGH</h1> | ||
| <form class='form__search'> | ||
| <input class="searchClass" type="search" results=5 placeholder="Search me"> |
There was a problem hiding this comment.
Clean indentation please
| topNews.articles.forEach(content => { | ||
| const spanNode = document.createElement("li"); // make fresh <li> | ||
| spanNode.innerHTML = // news contents | ||
| `<a href="${content.url}"> |
There was a problem hiding this comment.
indentation here would make the HTML easier to read
| const searchFunc = document.querySelector('.form__search'); | ||
| searchFunc.addEventListener("submit", function(event){ //COMBINE SEARCH AND INPUT?? | ||
| event.preventDefault(); | ||
| console.log(event.target['0'].value); // get the first item in teh form element. |
There was a problem hiding this comment.
It would be better to get the input using a selector rather than by index. That way if HTML gets moved around it will still work.
|
|
||
|
|
||
| //button function | ||
| function fetchingButtons(url, selector) { //button fetch addresses |
There was a problem hiding this comment.
I think this function can be removed as it does not get called
| }) | ||
| .then(function(body){ | ||
| parentNode.innerHTML = ""; | ||
| displayDataOnPage(body); |
| newsSource.articles.forEach(content => { | ||
| const spanNode3 = document.createElement("li"); | ||
| spanNode3.attribute | ||
|
|
There was a problem hiding this comment.
There are quite a few empty lines around. It would be better to remove them and keep empty lines to just one. It will make code easier to read.
|
Good work. Indentation and code layout needs more attention. Keeping it nicely laid out will make it easier to read. Also, I would have liked to see a README which explains what the project does, highlights any own features added etc. |
Styling needs finishing off & infographic function unworking/unfinished.