- Q4 A 1 Write Javascript Code To Create The Object Photol That Has The Following Properties And Values As Shown In 1 (49.46 KiB) Viewed 105 times
Q4. (a) (1) Write JavaScript code to create the object "Photol" that has the following properties and values as shown in
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Q4. (a) (1) Write JavaScript code to create the object "Photol" that has the following properties and values as shown in
Q4. (a) (1) Write JavaScript code to create the object "Photol" that has the following properties and values as shown in Figure 4.0: Property Value photoID 1 filename 1.jpg description Photo 1 Figure 4.0: Properties of Photo Object ( Write the JavaScript code to display the content of Photol object created in Q4(a)(i) as JSON string in an alert window. (ii) 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 <div> tag. All the <div> tags must be displayed in the clement 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.)