Question: (a) (i) Write JavaScript code to create the object Photol that has the following properties and values as shown in Figure 4.0: Property photoID
(a) (i) Write JavaScript code to create the object "Photol" that has the following properties and values as shown in Figure 4.0: Property photoID filename description Value 1 1.jpg Photo 1 Figure 4.0: Properties of Photo Object Write the JavaScript code to display the content of Photol object created in (a)(i) as JSON string in an alert window. (iii) If Photos contains an array of Photo objects with the properties as defined in Figure 4.0, write the JavaScript code that uses the JQuery "each" method to display all the photos. Each image must be displayed in a separate tag. All the tags must be displayed in the element that has the id "album". The output displayed by the web browser is as shown in Figure 4.1 below. Photo 1 Photo 2 Photo 3 Figure 4.1: Output of images displayed in web browser. [Note: For devices not capable of displaying images, the description of the photo will be shown instead.]
Step by Step Solution
3.41 Rating (148 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
