- gain a deeper appreciation for how JavaScript variables are created scoped
- create JSON Data to represent an object
- build objects from JSON data
- use jQuery Ajax methods to add HTML to display the object
https://github.com/htc-ccis2591/js-data/
You’ll want to begin each assignment by forking the repository and cloning it locally. When you are done, you’ll push to GitHub and submit a pull request.
A new section was added to the HTML to feature an item from the menu.
Use the information below to write JSON to hold the featured items for the week. Store this in a separate JSON file. Each featured item has a name, image, and description. There are two featured items this week, but there may be more later, so put them in an array and make sure that your JavaScript can process any number of featured items.
Item 1:
- name: "Hazelnut Cappuccino",
- image: "images/cappuccino.jpg",
- description: "A warm, soothing cappuccino with a touch of hazelnut to warm you as the weather turns."
Item 2:
- name: "Chocolate Cake",
- image: "images/choc-cake.jpg",
- description: "Our chocolate cake is rich, moist, and dark. More chocolate to love."
Use your JSON data to build and add HTML to show the two featured items in the “featured-items” div. Create and add the HTML to the page using JavaScript. The code that you write should be able to add any number of featured items to the page.