Creating the JSON file for albums

Before writing any JavaScript code, we need to prepare a JSON file with information about albums and the pictures in it. For this, we will create an array of objects. Each object will represent an album. For this chapter, we will create the JSON with three albums. The first album will have eight images, second will have four, and third will have none. While experimenting, you can of course change the number of images as you wish.

To begin with, let's write the complete JSON structure we will use for this chapter. Open the albums.json file in your text editor and write this data into it:

[ { "id":"A1", "albumName":"First Album", "pictures": [ { "id":1, "sequence":1, "imageTitle":"Rangoli", "imageThumb":"images/thumbs/1.jpg", ...

Get Mastering jQuery UI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.