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

Using Quotable API to fetch quotes #8

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

Conversation

Mudit-Jxin7
Copy link

Instead of hardcoding quotes and their authors, it is preferable to utilize third-party APIs. By leveraging such APIs, the code becomes cleaner and more concise, eliminating the need for manually inputting quotes. I have used one such API to dynamically fetch the quotes and their authors.

Copy link

@ritish78 ritish78 left a comment

Choose a reason for hiding this comment

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

An improvement over the current execution but the author has not been active for a while now.

quote.textContent = data.content;
cite.textContent = data.author;
} else {
quote.textContent = "An error occured";

Choose a reason for hiding this comment

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

I think it's better if another element is used to display an error message.

Alert might also do the job. And we leave quote.textContent the same as it was.

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.

3 participants