-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CP Project Cinema #17
base: master
Are you sure you want to change the base?
Conversation
|
||
searchFunc.addEventListener("submit", function(event) { | ||
event.preventDefault(); | ||
console.log(event.target['0'].value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented out code can be removed
if (search.Response === 'False') { | ||
parentSearchResult.innerHTML = ""; | ||
console.log(search) | ||
notFound(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
.then(function(result){ | ||
|
||
// If unknown result | ||
if (result.Response === 'False') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented code should be removed as it just adds clutter
} | ||
|
||
|
||
.results img{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would better handled using BEM class based selectors
Would love to see an updated README that explains the project |
First commit