Loading Please Wait...

Logo Lynxsia IT Solutions

JavaScript Web API

JS Web API

Web API can extend the functionality of the browser.

Web API can greatly simplify complex functions.

Web API can provide easy syntax to complex code.

What is Web API?

API stands for Application Programming Interface.

A Web API is an application programming interface for the Web.

A Browser API can extend the functionality of a web browser.

A Server API can extend the functionality of a web server.

Browser APIs

All browsers have a set of built-in Web APIs to support complex operations, and to help accessing data.

For example, the Geolocation API can return the coordinates of where the browser is located.

The following example get the latitude and longitude of the user's position:

					 
        
          const myElement = document.getElementById("demo");

          function getLocation() {
            if (navigator.geolocation) {
              navigator.geolocation.getCurrentPosition(showPosition);
            } else {
              myElement.innerHTML = "Geolocation is not supported by this browser.";
            }
          }

          function showPosition(position) {
            myElement.innerHTML = "Latitude: " + position.coords.latitude +
            "
Longitude: " + position.coords.longitude; }
Third Party APIs

Third party APIs are not built into your browser.

To use these APIs, you will have to download the code from the Web.

  • YouTube API - Allows you to display videos on a web site.
  • Twitter API - Allows you to display Tweets on a web site.
  • Facebook API - Allows you to display Facebook info on a web site.

How you feel about this blog:

Share this blog on:

Report Us

If you find any error in the turtorials, or want to share your suggestion/feedback, feel free to send us email at: info@lynxsia.com

Contact Us
Ads
Logo
Lynxsia IT Solutions

We are concern with various development process like website design & development, E-commerce development, Software development, Application development, SMS & Bulk SMS Provider, PWA Development, and many more..

Kotwali Road, Chhiptehri, Banda, 210001, UP, India

Copyright © 2022, Lynxsia IT Solutions, All rights reserved