The Store
First step in any online store is to display what you're selling.
Skills: OutputVariablesLoopsArraysObjects
This project is a chance for you to practice the skills you learnt in the previous three projects.
You'll need to use all of the skills to write the code. Here's some references to help:- arrays
[ ]
on javascript.info - loop through an array:
forEach
on javascript.info - objects
{ }
on javascript.info - objects
{ }
on W3Schools
Revision
Coming soon...
Brief
First, choose a product that you're online shop is going to sell. Then, find some images of your products (square images work best). You can use Unsplash to find copyright-free images to use in your websites. Finally, write a program to output your products and their details onto your website.
Doing it with JavaScript - rather than writing all the HTML by hand - makes it much easier to update your catalog with new items, or change existing ones.
Use the code below to get you started. Copy and paste the HTML into your own file. You do not need to write any more HTML to complete this project.
You can use the JavaScript below if you need help to get started. It contains comments explaining each step of this program.
If you can, try to complete the program without looking at it.