Lab 12 Reflection

     Lab 12 was about using JSON to make a video player webpage work. JSON is essentially an object-oriented notation used by JS to make it easy for humans to read and write the code and machines to parse and generate the code. The HTML file we were given had a list of video from which a video would display in the video player when clicked. The thing that needed to be fixed was a lack of title, author, and views when a video was clicked and displayed in the player. To fix this, I created several <h1> and <h2> tags in the HTML with ids relating to the type of content I wanted them to display, like title, author, and views. These tags were placed just about the video player and were blank for now. In the JS, each video was stored in an array as an object, with properties such as YouTube id. I made sure each video had a property that stored things like its title so I could implement it in my script later on. In the same function which displayed the video in the video player, I stored the HTML element meant to display certain details about the video in a variable, using that variable in combination with the .text() method of jQuery and the JS property of the video being clicked to display that specific detail. Now, not only did the video show up but its title, author, and views.
     These skills are important for a web designer because using JSON and object oriented programming can help make things coherent and efficient in a website. There can be many complex objects to display on a website, like a list of videos, which share many of the same properties. Using object-oriented programming can make managing these elements easier and using JSON can make the code more readable. Essentially, these skills help complete complex processes in a site with simplified code.

Comments

Popular Posts