-
Notifications
You must be signed in to change notification settings - Fork 43
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
Trek-Cara-Octors #44
base: master
Are you sure you want to change the base?
Trek-Cara-Octors #44
Conversation
TREKWhat We're Looking For
|
const clickTrip = (trip) => { | ||
console.log(trip) | ||
|
||
$('#view-trip').removeClass('hidden') |
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.
You probably want to empty the view-trip
section here too. As is, if you click on more than one trip the details for all the trips display on the screen at once.
$('#tablebody').append(`<p>Name: ${response.data.name}</p>`); | ||
$('#tablebody').append(`<p>Id: ${response.data.id}</p>`); $('#tablebody').append(`<p>Continent: ${response.data.continent}</p>`); | ||
$('#tablebody').append(`<p>About: ${response.data.about}</p>`); | ||
$('#tablebody').append(`<p>Category: </category>${response.data.category}</p>`); |
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.
It might make sense to break the code to render trip details out into a separate function - as is, this function is doing two things (making the request, and rendering data). See also http://callbackhell.com/
TREK
Congratulations! You're submitting your assignment!
Comprehension Questions