Skip to content

Conversation

@Ahmed-username
Copy link

No description provided.

return response.json();
})
.then(function(jsonData) {
window.scrollTo(0, 0);
Copy link
Contributor

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){
Copy link
Contributor

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);
Copy link
Contributor

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";
Copy link
Contributor

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
Copy link
Contributor

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

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