Skip to content

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