Friday, 4 September 2015

AJAX Introduction

Introduction

AJAX stands for Asynchronous JavaScript and XML. AJAX is not a new programming language, but a new way to use existing standards.
AJAX is the art of exchanging data with a server, and updating parts of a web page - without reloading the whole page.

Asynchronous JavaScript and XML?

A is for “asynchronous”
Requests can be made asynchronously or synchronously.
Both techniques allow web page to be updated without refreshing it.

JA is for “JavaScript”
Typically JavaScript is used on the client-side (in the browser).
Any language that accept HTTP requests and return HTTP responses can be used for server side.

X is for “XML”
Request and response messages can contain XML.
Can really contain any text (single text value, delimited text,…)

Why we need AJAX?

  1. Faster than the normal approach.
  2. More Interactive.
  3. Allows Asynchronous calls.
  4. Less Bandwidth usage.
  5. Ajax is server-agnostic.
The below 2 pictures explains, how AJAX loads partially without refreshing.

Normal Approach

 

client server interaction normal way






  

AJAX Approach

ajax approach


What are required to make a  Ajax call?

The following components are required to make a Ajax call.
  1. HTML.
  2. Cascading Style Sheets.
  3. Java Script & DOM.
  4. XmlHttpRequest / ActiveXObject.
  5. XML & JSON.
we will see how to make a call and How it works in next posts.

No comments:

Post a Comment