what does API mean? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what does API mean?

I did not understand about API. What is the code that has been used here? <!DOCTYPE html> <html> <body> <p>Click the button to get your coordinates.</p> <button onclick="getLocation()">Try It</button> <p id="demo"></p> <script> var x = document.getElementById("demo"); function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { x.innerHTML = "Geolocation is not supported by this browser."; } } function showPosition(position) { x.innerHTML = "Latitude: " + position.coords.latitude + "<br>Longitude: " + position.coords.longitude; } </script> </body> </html>

18th Feb 2019, 7:49 PM
mohammad mohebbullah
mohammad mohebbullah - avatar
1 Answer
+ 6
//In computer programming, an application programming interface is a set of subroutine definitions, communication protocols, and tools for building software. In general terms, it is a set of clearly defined methods of communication among various components. //Above code gives longitude and latitude of your current location
18th Feb 2019, 8:01 PM
Sudarshan Rai
Sudarshan Rai - avatar