-
Notifications
You must be signed in to change notification settings - Fork 34
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
week3 responsive-news-reader #7
base: master
Are you sure you want to change the base?
Conversation
return response.json(); | ||
}) | ||
.then(function(jsonData) { | ||
window.scrollTo(0, 0); |
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
} | ||
|
||
function prevHandler(event){ | ||
if(page<=1){ |
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 handling of edge case. Rather than using if/else I would return on the if to remove the need for an else.
if(page<=1){
alert("This is the first page");
return;
}
return response.json(); | ||
}) | ||
.then(function(jsonData) { | ||
window.scrollTo(0, 0); |
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(jsonData) { | ||
showResults(jsonData); | ||
searchBox.value=search; | ||
prev.style.display="block"; |
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 would be better to handle this using css classes rather than manipulating the style object
@@ -0,0 +1,3 @@ | |||
ab |
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.
maybe add this to .gitignore
No description provided.