AJAX Introduction
In this lesson, you will learn Ajax Introduction, What is Ajax How it Works, Benefits of Ajax.
What is Ajax How it Works?
Ajax acronym for Asynchronous JavaScript and XML.
Ajax is a Client side web technique.
JavaScript with AJAX you can able to make background server calls for fetching addition data, Updating some portion in web page without refreshing the whole page.
-
AJAX is based on JavaScript and HTTP requests.
-
AJAX is not a new programming language, but a new way to use existing standards with DOM manipulating.
-
JavaScript is help to a AJAX to make background AJAX calls for fetching certain amount of data.
-
Without AJAX, traditional web page takes a longer time to finishing round trip process for getting a data form the server. So it's time-consuming process even if small changes are in web page, entire web page reload.
-
In a traditional web page you can't update small portion without reloading page. So here Ajax is help us to background server calls for fetching data and update new contain without reloading page.
-
AJAX is a type of programming made popular in 2005 by Google (with Google Suggest).
Without/With using Ajax:
Let's take one example we have a website for user management system.
Without Ajax, Whenever we want to access account, we press login link. New login page open and enter username, password, and login successfully. It's time consuming process, inefficient for only small amount data(Login page) exchange required.
Now With Ajax, We want to access account, we press login link. Background Javascript call to a server for fetching login portion and update/add to current web page. Now we can enter username, password and login successfully. It's take small bit of time for this process.
Ajax behind Process (How to Work Ajax)
HTML/CSS
HTML/CSS is website markup language for defining web page layout, such as fonts style and colors.
JavaScript
JavaScript is a web scripting language. JavaScript special object XMLHttpRequest that was designed by Microsoft. XMLHttpRequest provides an easy way to retrieve data from web server without having to do full page refresh. Web page can update just part of the page without interrupting what the users are doing.
Document Object Model
Document Object Model (DOM) method provides a tree structure as a logical view of web page.
XML
XML is a format for retrieve any type of data, not just XML data from the web server. However you can use other formats such as Plain text, HTML or JSON (JavaScript Object Notation). and it supports protocols HTTP and FTP.
Benefits of Ajax
-
Using AJAX you can create better, faster, and more user-friendly web applications.
-
Ajax is based on JavaScript, CSS, HTML and XML etc. So you can easily learn.
-
Ajax behavior and works is like a desktop application. So Ajax use for creating a rich web application.