JavaScript for E-Commerce

Back | Contents | Next

Framework

At this point we have enough information to build a navigable online shop, assuming that we have a list of CDs, records and tapes to sell.

The site will be built using frames, because we are going to use JavaScript to store a list of items the customer has ordered. If it was done with separate pages, you would lose this information every time the user navigated to a different page, unless cookies were used to store this data. The problem with doing this is that you end up with a lot of duplicated code in each page for loading and saving cookies.

The screen will be split into two distinct areas. The smaller area will allow the user to select product type and category, and to view a list of items. The larger area will be for display of the individual items themselves. More or less, it will look something like this:

[Product Type] [Item Name]  [Item Price]

[Item Picture]

[Item Description]
[Category]
- Item 1
- Item 2
- Item 3
- Item 4
- Item 5

Looking at this, we need several HTML documents:


Back | Contents | Next

If you find this tutorial useful and want to show your apprectiation, a small donation is most welcome.