The program must work per specifications.

computer science

Description

Instructions:

  1. The program must work per specifications.
  2. The main function should use fetch to read in this JSON file: '/~tpollard/csci212/data/warhol.json'
  3. Then convert the JSON data string into a JavaScript object.
  4. Pass the object to a function that processes the object and builds the new DOM nodes.
  5. Read the contents of the template element from the DOM.
  6. Loop through the object.
  7.  Read a record from the object. 
  8. Make a clone of the template using cloneNode.
  9. Add the 'title' value from the object to the contents of the <h1> tag.
  10. Add the 'url' value from the object to the 'href' attribute of the <a> tag.
  11. Add the 'inscription' value from the object to the 'alt' attribute of the <img> tag.
  12. Add the first image (images[0]) value from the object to the 'src' attribute of the <img> tag.
  13. Add the 'inscription', 'mediumTechnique', and 'dating' values from the object to the contents of the <p> tag. Format the 3 variables so there is one space between each variable.
  14. Add the 'credit' value from the object to the contents of the <footer> tag.
  15. Add the article clone to the DOM fragment.
  16. After all the articles have been added to the DOM fragment add the fragment to the DOM.

Instruction Files
index.html
833.0 Bytes

Related Questions in computer science category