Question
Most modern programming languages operate using Object-Oriented Design, and the vast majority of web design languages use objects to communicate (or something similar like structs
Most modern programming languages operate using Object-Oriented Design, and the vast majority of web design languages use objects to communicate (or something similar like "structs" in Go). In an attempt to standardize object communication between back end software and front end scripting, JSON (JavaScript Object Notation) was created in the late 90s, early 00s. For this discussion use the following JSON object:
{"Title":"TRON","Year":"1982","Rated":"PG","Released":"09 Jul 1982","Runtime":"96 min","Genre":"Action, Adventure, Sci-Fi","Director":"Steven Lisberger","Writer":"Steven Lisberger (screenplay), Steven Lisberger (story), Bonnie MacBird (story)","Actors":"Jeff Bridges, Bruce Boxleitner, David Warner, Cindy Morgan","Plot":"A computer hacker is abducted into the digital world and forced to participate in gladiatorial games where his only chance of escape is with the help of a heroic security program.","Language":"English","Country":"USA","Awards":"Nominated for 2 Oscars. Another 2 wins & 6 nominations.","Poster":"https://images-na.ssl-images-amazon.com/images/M/MV5BMzZhNjYyZDYtZmE4MC00M2RlLTlhOGItZDVkYTVlZTYxOWZlXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_SX300.jpg","Ratings":[{"Source":"Internet Movie Database","Value":"6.8/10"},{"Source":"Rotten Tomatoes","Value":"70%"},{"Source":"Metacritic","Value":"58/100"}],"Metascore":"58","imdbRating":"6.8","imdbVotes":"101,127","imdbID":"tt0084827","Type":"movie","DVD":"15 Jan 2002","BoxOffice":"N/A","Production":"Buena Vista Pictures","Website":"N/A","Response":"True"}
To get this JSON object I issued a GET request to http://www.omdbapi.com/?t=tron&apikey=
1. After you load the tronObject, use DOM injection to display (at minimum) the title, year, and poster styled to your choosing.
2. Provide a toggle button that then switches the tronObject with a second object you retrieve using the omdb API.
3. Create a Discussion Board post here with the url of the GET request you used (don't include your API key).
There should be only ONE function that you pass the object into to display the code. Pseudocode of this expected function is below:
var tronObject = {...}
var mySecondObject = {...}
function loadObject(object){
//pseudocode, you have to write your own statements here
display object.Title
display object.Year
display object.Poster
}
On toggle button press { loadObject(tronObject) || loadObject(mySecondObject) } //also pseudocode I highly recommend you use jQuery statements for the DOM injection and Ajax calls for the GET requests.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started