5,838
edits
*The jQuery get request takes the api URL as first parameter and the function to deal with the returned result as third parameter
*The middle parameter is irrelevant in this context as only one object instance is returned, but if the qet was returning multiple results, "limit=1" would only return the first result
*The function takes as its sole parameter an Object (a JavaScript Object is a collection of properties), this is what is returned by the api,
*In JavaScript if a variable is defined outside the function, then given a value inside the function, that value can be accessed by later code outside the function (in my case by code within the other functions for calculating each derived value)
*We are only interested in 3 of the '''property_name = property_value''' items in the Object.
*
*The console.log command simply outputs all the items in the list within the brackets into the browser console that in many browsers is displayed by selecting '''F12''' on the keyboard. I included this instead of the lengthy rest of my code that uses the units to do the various calculations correctly.
|
edits