Question: Lab Description 1 . The HTML page called Lab 2 . html which is part of the same Lab 2 . zip file containing the

Lab Description
1. The HTML page called Lab2.html which is part of the same Lab2.zip file containing the
current PDF document should be renamed with your first name as a prefix. For example:
Jim_Lab2.html.
2. Lab2.html contains a script section with a global JavaScript variable called json. In addition,
an event handler called startMeUp is also defined and referenced with an onload event in
the tag.
3. The json variable contains location information about several businesses in the London
area. The objective of this exercise is to extract a subset of the information based on the
following property names:
a. name
b. address
c. category_labels
d. website
4. You may use let(rather than var) to declare any variables you need in your solution
although its not required.
5. You should begin by converting the JSON string to a JavaScript object.
6. Use document.write to display the above properties and property arrays for each of the
locations in the data. Write the JavaScript code to do this from within the startMeUp event
handler function. Note that category_labels must be displayed as one per line (also see
requirement #9 below).
7. Finally, as youre displaying the property information for each business, add a new
property to the business object called viewDate. This property should have the
value of the current JavaScript date as returned from using new Date();
8. When youve processed all the businesses, convert your JavaScript object back to a
JSON string and then dump the string at the bottom of your output using
document.write (see the attached example).
9. Its important that your solution is flexible enough to work for json data that contains
more (or less) locations than the example provided and will work with any number of
category_labels per business.
10. The following is an example of the required display format:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!