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

An Introduction to Spring Framework

An Introduction to Spring Framework   What is Spring ? Spring is an application framework . Unlike single-tier frameworks such as Struts or Hibernate, Spring aims to help structure whole applications in a consistent, productive manner, pulling together best-of-breed single-tier frameworks to create a coherent architecture. Why Spring ? The Spring Framework is an open source application framework that aims to make J2EE development easier. We’ll look at the motivation for Spring, its goals, and how Spring can help you develop high-quality applications quickly. Using J2EE “out of the box” is not an attractive option. Many J2EE APIs and services are cumbersome to use. J2EE does a great job of standardizing low-level infrastructure, solving such problems as how can Java code access transaction management without dealing with the details of transactions. But J2EE does not provide an easily usable view for application code.That is the role of an application framework, such a

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 also ru

Liscov Substitution principle

Liscov Substitution Principle  Inheritance is one of the important OOP concept. Liscov Substitution Principle is applied when using inheritance in our program. We must make sure that the child classes just extend without replacing the functionality of parent class. Otherwise the child classes can produce undesired effects when they are used in existing program modules. child component must be completely substitutable for their parent components . As an example if we take the classes " Rectangle" and "Square" In mathematics square is also a kind of rectangle. which makes the square class a child of rectangle class. rectangle class has some methods and they might be over ridden by the square class. if we have a function draw() and we do not know what shape will be returned but it will surely be a rectangle. If we give the length = 10 cm and width = 5 cm violating the Liscov Substitution principle is when the first length entered will be taken as the length of