Conversation
|
|
||
| searchFunc.addEventListener("submit", function(event) { | ||
| event.preventDefault(); | ||
| console.log(event.target['0'].value); |
There was a problem hiding this comment.
Get the input value using query selector rather than index of the form. It will make the code more robust and less likely to break in future if we move elements around
|
|
||
| //Search result function / index of links/li's | ||
|
|
||
| function IMDBData(search) { |
There was a problem hiding this comment.
functions names should not start with capital letters as they are reserved for constructors. Also, function name should better indicate what it does rather than be a noun
| function IMDBData(search) { | ||
| // console.log(search.Search[4].Poster); | ||
|
|
||
| search.Search.map((movies) => { |
There was a problem hiding this comment.
this should be a forEach as it does not return anything
| fetchTrailer(trailerURL); | ||
| let imdbID = movies.imdbID; | ||
| // defunct function to push more info next to relevant film | ||
| // imdbInfo(imdbID) |
There was a problem hiding this comment.
commented out code can be removed
| if (search.Response === 'False') { | ||
| parentSearchResult.innerHTML = ""; | ||
| console.log(search) | ||
| notFound(); |
| .then(function(result){ | ||
|
|
||
| // If unknown result | ||
| if (result.Response === 'False') { |
There was a problem hiding this comment.
good use of response checking
|
|
||
| function movieMore(finder){ | ||
|
|
||
| //defunct attempt at inserting more info to right of relevant film div |
There was a problem hiding this comment.
commented code should be removed as it just adds clutter
| } | ||
|
|
||
|
|
||
| .results img{ |
There was a problem hiding this comment.
this would better handled using BEM class based selectors
|
Would love to see an updated README that explains the project |
First commit