Book Image

Mastering jQuery UI

By : Vijay Joshi
Book Image

Mastering jQuery UI

By: Vijay Joshi

Overview of this book

Table of Contents (19 chapters)
Mastering jQuery UI
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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",
        "imageLarge":"images/1.jpg"
      },
      {
        "id":2,
        "sequence":2,
        "imageTitle":"Fair",
        "imageThumb":"images/thumbs/2.jpg",
        "imageLarge...