Skip to main content

Ajax and API

API - Application Program Interface 

It is a  set of functions and procedures that allow the creation of applications which access the features or data of an operating system, application, or other service.

what i understood..

It is like a middle ware between user and the database ( can made from java/PHP/java script) .
Not giving the full access to the user
Hiding the real data ( like a SQL view or can be real data too)
in web services we use " ajax " to access the  database through API ( not always )

user uses --> ajax --> to access API -->database

AJAX - Asynchronous JavaScript and XML

 In a nutshell, it is the use of the XMLHttpRequest object to communicate with server-side scripts. It can send as well as receive information in a variety of formats, including JSON, XML, HTML, and even text files

AJAX is a developer's dream, because you can:
  • Update a web page without reloading the page
  • Request data from a server - after the page has loaded
  • Receive data from a server - after the page has loaded
  • Send data to a server - in the background

what is learnt in lab class..


Write a function to call GitHub API (https://api.github.com/users) and get users and return the users to the caller.

function getSomething() {
    $.ajax({
        url: 'https://api.github.com/users',
        method: 'POST',
        success: function (data) {
            console.log(data);
        },
        error: function (data) {
            console.log(data);
        }
    });
};

getSomething();

Comments

  1. LuckyClub - LuckyClub Live Casino Review 2021
    Lucky Club is a great way to try our new game and try out the latest slots. This luckyclub game allows you to experience more than just slots. The

    ReplyDelete

Post a Comment

Popular posts from this blog

MongoDB Up & Running

MongoDB Up & Running What is mongoDB ?             Mongo DB has rapidly grown to become a popular database for web applications and is a perfect fit for Node.JS applications, letting you write Javascript for the client, backend and database layer. Its schemaless nature is a better match to our constantly evolving data structures in web applications, and the integrated support for location queries is a bonus that’s hard to ignore. Throw in Replica Sets for scaling, and we’re looking at really nice platform to grow your storage needs now and in the future. MongoDB is an   open source   database that uses a document-oriented data model.MongoDB is one of several   database   types to arise in the mid-2000s under the   NoSQL   banner. Instead of using   tables   and   rows   as in   relational databases, MongoDB is built on an architecture of collections and documents. Do...

Apache Maven

Introduction to Apache Maven   What is maven? Maven is a project management tool which encompasses a project object model, a set of standards, a project life cycle, a dependency management system, and logic for executing plugin goals at defined phases in a life cycle. When you use Maven, you describe your project using a well-defined project object model, Maven can then apply cross-cutting logic from a set of shared (or custom) plugins. The great majority of Maven users are going to call Maven a “build tool”: a tool used to build deployable artifacts from source code. Build engineers and project managers might refer to Maven as something more comprehensive: a project management tool. What is the difference? A build tool such as Ant is focused solely on preprocessing, compilation, packaging, testing, and distribution. A project management tool such as Maven provides a super set of features found in a build tool. In addition to providing build capabilities, Maven can als...

Tour Management System - 2nd year ITP project

   Introduction to the System  The Lotus Tours Company which is located in Nugegoda, provides a good service to the customers who wish to visit sacred places in India and Thailand. India and Thailand are some beautiful countries in Asia. A trip to these countries can reveal numerous mystic things regarding its culture, art tradition history etc. Any person who wish to travel through the Lotus Company are allowed. Even the customers who doesn’t have a passport can reserve a date and get registered. Company will get all the details from the customer who doesn’t have a passport and help to prepare a new passport for them They have many packages in different prices. To get registered every customer should deposit Rs. 10,000 in advance. Then the rest of the amount are paid in installments prior to the tour date or the full amount for the tour can be paid at once. When a customer make a reservation, all the reservation details are recorded in a file and unique ID numbe...