Skip to content

Conversation

@majaengberg02
Copy link

@JennieDalgren JennieDalgren self-assigned this Oct 26, 2025
Copy link

@JennieDalgren JennieDalgren left a comment

Choose a reason for hiding this comment

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

Good job with this project!

You code is clean and easy to follow. I'm a bit confused over the way you're fetching from the API. Refactor that into the way we teach in the education. Other than that, you have met the requirements. When that is fixed I can approve this project.

I can see that some code is generated by AI, that is totally fine as long as you understand what is going on and can explain it. Remember that it is important to understand the basic javascript concepts and programming fundamentals to be able to utilise the power of AI as a code buddy in a good and safe way.

data.js Outdated
Comment on lines 2 to 4
const xhttp = new XMLHttpRequest();
xhttp.open("GET", "https://api.spoonacular.com/recipes/random?apiKey=24c0ad763b794214b472e5a5e70fac09&number=20&includeNutrition=false", false);
xhttp.send();

Choose a reason for hiding this comment

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

what is this XMLHttpRequest for?

Copy link
Author

Choose a reason for hiding this comment

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

It creates an object that fetches data from the server. It requests for data in the background and updates the page without reloading it for the client. It’s an older way to make HTTP requests that I thought was a bit easier to understand and use in the beginning, and for this smaller project.

script.js Outdated
const card = document.createElement('article');
card.className = 'recipe-card';
card.tabIndex = 0; // Makes card focusable for accessibility
card.style.cursor = 'pointer'; // Shows pointer on hover

Choose a reason for hiding this comment

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

this should be controlled in the css file, just as the rest of the .recipe-card styling

Copy link

@JennieDalgren JennieDalgren left a comment

Choose a reason for hiding this comment

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

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