Skip to content
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

Carets - Maria - Trek #38

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Carets - Maria - Trek #38

wants to merge 12 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 27, 2017

TREK

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What does it mean for code to be asynchronous? You can do many things at once and still interact with a webpage while AJAX waits for a response.
Describe a piece of your code that executes asynchronously. How did this affect the way you structured it? My understanding is that AJAX & jQuery are asynchronous, so as long as the iQuery is within the document ready tag, it will run asynchronously.
What kind of errors might the API give you? How did you choose to handle them? I gave the .fail error and used console log to show errors, although I'm not sure it's working correctly. My post action doesn't work 100% of the time, but in the console in developer tools, it's not showing the fail message. I'm not entirely sure why a post request would work on one occasion, but not all. Instead, it's showing only the always message instead.
Do you have any recommendations on how we could improve this project for the next cohort? Not sure, I had some trouble with post and how the form fits into my HTML for some reason, so more lecture surrounding that could be nice, but that seems less about the project.

@CheezItMan
Copy link

TREK

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Good number of commits and good commit messages
Comprehension questions Check, the asynchronous pieces of code are where the code runs in an order you can't predetermine, like when you have event handlers. So when you click on a button and JS code runs, that function is running asynchronously.
Functionality
Click a button to list trips Check
Click a trip to see trip details Check
Fill out a form to reserve a spot Check
Errors are reported to the user Yes!, but you probably should style error messages so they stand out. Otherwise it's hard for the user to notice. Just a user experience tip.
Styling, Foundation grid layout No grid layout, styling is basic, but works.
Under the Hood
Trip data is retrieved using jQuery AJAX Check
JavaScript is well-organized and easy to read Pretty good job. Check the linter and my comment for a few minor issues.
HTML is semantic Too maaaaaaany div elements!
Overall Nice work. The text is a little hard for me to read, but the site does everything it's required to. Good job!

@@ -0,0 +1,87 @@
$(document).ready(() => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This blank line isn't needed.

}; // end of loadTrips

const loadTrip = function loadTrip(id) {
$.get(`https://trektravel.herokuapp.com/trips/${id}`,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This parameter is long enough it should probably be in a separate line.

});
}; // end of loadTrip

$('#trips ul').on('click', 'p', function() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should name this event handler:
$('#trips ul').on('click', 'p', function loadTripClickHandler() {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants