SlideShare a Scribd company logo
AJAX
AN INTRODUCTION




                  Page 1
AGENDA
•   WHAT IS AJAX?
•   HISTORY
•   GOOGLE SUGGEST
•   SIMPLE PROCESSING
•   COMPONENTS
       •   XHTML,CSS
       •   DOM
       •   XML
       •   HTTP REQUEST OBJECT
       •   JAVA SCRIPT
• PROCESS CYCLE
• AJAX ADVANTAGES AND DISADVANTAGES
• EXAMPLE


                                      Page 2
BACK THEN…




Click
Search




              Page 3
AND YOU GET THIS …




                     Page 4
THESE DAYS..




               Page 5
THE MAGIC SPELL BEHIND THIS IS

             AJAX
(Asynchronous JavaScript and XML)



                              Page 6
SO WHAT IS AJAX ???
 A programming language – no…
 A new technology – not exactly…
 So what else ?


   It is a methodology on using several web technologies
   together, in an effort to close the gap between the usability
   and interactivity of a desktop application and the ever
   demanding web application




                                                               Page 7
 Asynchronous Javascript and XML is a client side
  techniques that combines a set of known technologies in
  order to create faster and more user friendly web pages.
 AJAX provides an ability to communicate with the server
  asynchronously.


                    ASYNCHRONOUS???
     We can send a request to server and continue user
     interaction with the user with out waiting for server
     response. Once the response arrives, a designated area
     in UI will update itself and reflect the response
     information. Whole page need not be reloaded


                                                              Page 8
HISTORY OF AJAX
 Starts with web pages

 Static web pages
    Static html page is loaded
    No interaction with user

 Dynamic web pages
    Html page is generated dynamically
    Interaction with user
    Becomes slower as functionality increases
    Speed becomes intolerable, so AJAX has been born

                                                    Page 9
 The term AJAX is coined on February 18, 2005, by Jesse
  James Garret in a short essay published a few days after
  Google released its Maps application.

 In the year 2006, the W3C (World Wide Web Consortium)
  announces the release of the first draft which made AJAX
  an official web standard.




                                                       Page 10
GOOGLE SUGGEST

Google Suggest is
using AJAX to create
a very dynamic web
interface: When you
start typing in
Google's search
box, a JavaScript
sends the letters off
to a server and the
server returns a list
of suggestions.


                                 Page 11
SİMPLE PROCESSİNG
• AJAX is based on Javascript, and the main functionality is
  to access the web server inside the Javascript code.




                            When user
                                                The received
  We access to the         initiates an
                                               information is
    server using       event, a javascript
                                             shown to the user
 special objects; we    function is called
                                              by means of the
   send data and          which accesses
                                                Javascript’s
   retrieve data.        server using the
                                                 functions.
                             objects.




                                                          Page 12
COMPONENTS OF AJAX
• Ajax incorporates several technologies, each flourishing in
  its own right, coming together in powerful new ways.

   –   standards-based presentation using XHTML, CSS
   –   dynamic display and interaction using DOM
   –   data interchange and manipulation using XML
   –   asynchronous data retrieval using XMLHttpRequest
   –   and JavaScript binding everything together.




                                                          Page 13
XHTML, CSS

• XHTML stands for EXtensible HyperText Markup
  Language
   – It consists of all the elements in HTML 4.01 combined
     with the syntax of XML

• CSS stands for Cascading Style Sheets
   – It is used to describe the presentation of a document
     written in HTML or XML.




                                                             Page 14
DOM
• Document Object Model for HTML
   DOM provides a standard set of objects for representing
    HTML and XML documents, and a standard interface
    for accessing and manipulating them.

   Essentially, it connects web pages to scripts or
    programming languages.

   It defines an HTML document as a collection of objects
    that have properties and methods and that can respond
    to events




                                                        Page 15
XML
• EXtensible Markup Language

   XML was designed to describe data and to focus on
    what data is (unlike HTML which was designed to
    display data and to focus on how data looks)

   It is a general-purpose markup language for creating
    special-purpose markup languages that carry data.




                                                           Page 16
XMLHttpRequest
                                        XmlHttp
 The kernel of Ajax
                                        Request
                                         Object

 The XMLHttpRequest object allows client-side JavaScript
  to make HTTP requests (both GET and POST) to the server
  without reloading pages in the browser.

 This JavaScript object was originally introduced in Internet
  Explorer 5 by Microsoft and it is the enabling technology
  that allows asynchronous requests



                                                          Page 17
XMLHttpRequest

• By performing screen updates on the client, you have a
  great amount of flexibility when it comes to creating your
  Web site :

    Eliminate page refreshes every time there is user input
    Edit data directly in place, without requiring the user
     to navigate to a new page to edit the data
    Increase site performance by reducing the amount of
     data downloaded from the server

• The possibilities are endless!


                                                          Page 18
JavaScript
 JavaScript is one of the world's most popular programming
  languages
    Its popularity is due entirely to its role as the scripting
     language of the WWW along with VBScript

 JavaScript has a syntax similar to Java but:
    It is not a real programming language (it is script)
    It was developed at Netscape and not Sun.
    It was originally called LiveScript




                                                            Page 19
JavaScript
• JavaScript binds all the mentioned technologies together to
  create the Ajax “pattern”.

When a user clicks a button, you can use JavaScript
and XHTML to immediately update the UI


     Spawn an asynchronous request to the server using the
     XMLHttpRequest object via JavaScript to perform
     an update or query a database.

          When the request returns as XML, you can then use
          JavaScript, CSS, DOM to update your UI
          accordingly without refreshing the entire page.

                Most importantly, users don't even know your code is
                communicating with the server: the Web site feels like
                it's instantly responding ("desktop-like" usability)
                                                                         Page 20
THE PROCESS CYCLE




                    Page 21
BENEFITS OF USING AJAX
• Helps to build fast, dynamic websites.
• Ajax allows to perform processing on client computer (in
  JavaScript) with data taken from the server thereby
  reducing server load by moving a part of server
  functionality to client side.
• Ajax can selectively modify a part of a page displayed by the
  browser, and update it without the need to reload the whole
  document with all images, menus etc. This bridges the gap
  between desktop and web applications.
• Saves bandwidth by only transmitting new information
• Creates possibility of entirely new types of user interfaces
  not possible in traditional model.


                                                          Page 22
AJAX DISADVANTAGES
 Poor compatibility with very old or obscure
  browsers, and many mobile devices.

 Limited Capabilities like multimedia, interaction with
  web-cams and printers, local data storage and real time
  graphics.

 Not everyone have JavaScript enabled. If JavaScript is
  not activated, Ajax can't works. The user must be asked
  to set JavaScript from within options of the
  browser, with the "noscript" tag.

 Too much code makes the browser slow.

                                                      Page 23
• The back button problem. People think that when they
  press back button, they will return to the last change they
  made, but in AJAX this doesn not hold.

• Possible network latency problems. People should be given
  feedback about the processing.

• Does not run on all browsers.




                                                           Page 24
XMLHTTPREQUEST OBJECT
Important Methods

     Open(“method”,”url”,boolean)

          to send a request to server
          method - GET or POST
          url       - address of the target file
          boolean - to denote whether the request is
         synchronous or asynchronous. If true, asynchronous.

     Send(content)

          to send data to server for processing
          content - may be string or DOM type of document.


                                                               Page 25
IMPORTANT PROPERTIES
 readystate
   - used to identify the state of the request. Possible values 0-4.
 onreadystatechange
   - event handler for an event that fires at every state change.
 status
   -Numeric code return by server.Eg.404,200
 responseText
   - the string data returned by the server process.
 responseXML
    - the DOM type of document returned by the server process.



                                                                 Page 26
CREATE XMLHTTPREQUEST OBJECT
  var request;
 if (window.ActiveXObject)
          {
          /*supperted in IE*/
                    request = new
          ActiveXObject("Microsoft.XMLHTTP");
          }
          else if (window.XMLHttpRequest)
          {
          /* supported in Safari and Mozilla*/
                    request = new XMLHttpRequest();
          }
          else
          {
                    request = null;
          }
                                                      Page 27
CREATE XMLHTTPREQUEST OBJECT
        request.open("GET", "message.html", true);
        request.onreadystatechange = function()
{
        if (request.readyState == 4)
        {
              if(request.status == 200)
              {
                    /*in the case of string data*/
        var str = request.responseText;
        document.getElementById(‘tag id’).innerHTML = str ;

                  /*in the case of XML document*/
                  var response = request.responseXML;
                  var doc = response.documentElement;
var data1 = doc.getElementByTagName(‘tagname’)[0].firstchild.nodeValue;
              }
         }
}
         request.send(null);
                                                                      Page 28
JAVASCRIPT LIBRARY


A JavaScript library is a library of pre-written JavaScript
which allows for easier development of JavaScript-based
applications, especially for AJAX.

Some popular javascript libraries are
jQuery, MooTools, Prototype, Dojo.

With the help of the javascript library functions dynamic
web page development will be easier.




                                                             Page 29
THANK YOU…




             Page 30

More Related Content

What's hot

Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)
Adnan Sohail
 
Servlets
ServletsServlets
Servlets
ZainabNoorGul
 
Introduction to ajax
Introduction  to  ajaxIntroduction  to  ajax
Introduction to ajax
Pihu Goel
 
Event In JavaScript
Event In JavaScriptEvent In JavaScript
Event In JavaScript
ShahDhruv21
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
Walid Ashraf
 
Ajax ppt - 32 slides
Ajax ppt - 32 slidesAjax ppt - 32 slides
Ajax ppt - 32 slides
Smithss25
 
jQuery Ajax
jQuery AjaxjQuery Ajax
jQuery Ajax
Anand Kumar Rajana
 
Xml parsers
Xml parsersXml parsers
Xml parsers
Manav Prasad
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
Vikas Jagtap
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
IT Geeks
 
JSON: The Basics
JSON: The BasicsJSON: The Basics
JSON: The Basics
Jeff Fox
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypesVarun C M
 
JavaScript - Chapter 8 - Objects
 JavaScript - Chapter 8 - Objects JavaScript - Chapter 8 - Objects
JavaScript - Chapter 8 - Objects
WebStackAcademy
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
Taha Malampatti
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
Bala Narayanan
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
Rajkumarsoy
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Vikash Singh
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
Mohammed Arif
 
Database Connectivity in PHP
Database Connectivity in PHPDatabase Connectivity in PHP
Database Connectivity in PHP
Taha Malampatti
 

What's hot (20)

Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)
 
Servlets
ServletsServlets
Servlets
 
Introduction to ajax
Introduction  to  ajaxIntroduction  to  ajax
Introduction to ajax
 
Event In JavaScript
Event In JavaScriptEvent In JavaScript
Event In JavaScript
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
 
Ajax ppt - 32 slides
Ajax ppt - 32 slidesAjax ppt - 32 slides
Ajax ppt - 32 slides
 
jQuery Ajax
jQuery AjaxjQuery Ajax
jQuery Ajax
 
Xml parsers
Xml parsersXml parsers
Xml parsers
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
JSON: The Basics
JSON: The BasicsJSON: The Basics
JSON: The Basics
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypes
 
JavaScript - Chapter 8 - Objects
 JavaScript - Chapter 8 - Objects JavaScript - Chapter 8 - Objects
JavaScript - Chapter 8 - Objects
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
 
Database Connectivity in PHP
Database Connectivity in PHPDatabase Connectivity in PHP
Database Connectivity in PHP
 

Viewers also liked

Ajax:From Desktop Applications towards Ajax Web Applications
Ajax:From Desktop Applications towards Ajax Web ApplicationsAjax:From Desktop Applications towards Ajax Web Applications
Ajax:From Desktop Applications towards Ajax Web Applications
Siva Kumar
 
Deque and its applications
Deque and its applicationsDeque and its applications
Deque and its applicationsTech_MX
 
Db for rdbms
Db for rdbmsDb for rdbms
Db for rdbmsTech_MX
 
Object type casting
Object type castingObject type casting
Object type castingTech_MX
 
Inner Classes & Multi Threading in JAVA
Inner Classes & Multi Threading in JAVAInner Classes & Multi Threading in JAVA
Inner Classes & Multi Threading in JAVATech_MX
 
Ascii adjust & decimal adjust
Ascii adjust & decimal adjustAscii adjust & decimal adjust
Ascii adjust & decimal adjustTech_MX
 
Comparison of pentium processor with 80386 and 80486
Comparison of pentium processor with  80386 and 80486Comparison of pentium processor with  80386 and 80486
Comparison of pentium processor with 80386 and 80486Tech_MX
 
Advantages and disadvantages of an ajax based client application
Advantages and disadvantages of an ajax based client applicationAdvantages and disadvantages of an ajax based client application
Advantages and disadvantages of an ajax based client application
Placinta Alin
 
MultiMedia dbms
MultiMedia dbmsMultiMedia dbms
MultiMedia dbmsTech_MX
 
8237 dma controller
8237 dma controller8237 dma controller
8237 dma controllerTech_MX
 
Mobile dbms
Mobile dbmsMobile dbms
Mobile dbmsTech_MX
 
How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagramTech_MX
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
Nir Elbaz
 
Virtual base class
Virtual base classVirtual base class
Virtual base classTech_MX
 

Viewers also liked (17)

Ajax:From Desktop Applications towards Ajax Web Applications
Ajax:From Desktop Applications towards Ajax Web ApplicationsAjax:From Desktop Applications towards Ajax Web Applications
Ajax:From Desktop Applications towards Ajax Web Applications
 
Deque and its applications
Deque and its applicationsDeque and its applications
Deque and its applications
 
Db for rdbms
Db for rdbmsDb for rdbms
Db for rdbms
 
Object type casting
Object type castingObject type casting
Object type casting
 
Ot ppt
Ot pptOt ppt
Ot ppt
 
Inner Classes & Multi Threading in JAVA
Inner Classes & Multi Threading in JAVAInner Classes & Multi Threading in JAVA
Inner Classes & Multi Threading in JAVA
 
Ascii adjust & decimal adjust
Ascii adjust & decimal adjustAscii adjust & decimal adjust
Ascii adjust & decimal adjust
 
Parsing
ParsingParsing
Parsing
 
Comparison of pentium processor with 80386 and 80486
Comparison of pentium processor with  80386 and 80486Comparison of pentium processor with  80386 and 80486
Comparison of pentium processor with 80386 and 80486
 
Advantages and disadvantages of an ajax based client application
Advantages and disadvantages of an ajax based client applicationAdvantages and disadvantages of an ajax based client application
Advantages and disadvantages of an ajax based client application
 
MultiMedia dbms
MultiMedia dbmsMultiMedia dbms
MultiMedia dbms
 
8237 dma controller
8237 dma controller8237 dma controller
8237 dma controller
 
Ajax Ppt
Ajax PptAjax Ppt
Ajax Ppt
 
Mobile dbms
Mobile dbmsMobile dbms
Mobile dbms
 
How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagram
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
 
Virtual base class
Virtual base classVirtual base class
Virtual base class
 

Similar to Ajax

Ajax & Reverse Ajax Presenation
Ajax & Reverse Ajax PresenationAjax & Reverse Ajax Presenation
Ajax & Reverse Ajax Presenation
Rishabh Garg
 
Intoduction to Ajax
Intoduction to AjaxIntoduction to Ajax
Intoduction to Ajax
RISHAV ANURAG
 
AJAX
AJAXAJAX
M Ramya
M RamyaM Ramya
Asynchronous javascript and xml
Asynchronous javascript and xmlAsynchronous javascript and xml
Asynchronous javascript and xml
Bui Kiet
 
Ajax ppt
Ajax pptAjax ppt
Evolution of java script libraries
Evolution of java script librariesEvolution of java script libraries
Evolution of java script libraries
Columbia Developers Guild
 
Ajax
AjaxAjax
Ajax
AjaxAjax
AJAX
AJAXAJAX
25250716 seminar-on-ajax text
25250716 seminar-on-ajax text25250716 seminar-on-ajax text
25250716 seminar-on-ajax text
Kamleshh Chandnani
 
Ajax assignment help
Ajax assignment helpAjax assignment help
Ajax assignment help
john mayer
 
Ajax Basics And Framework
Ajax Basics And FrameworkAjax Basics And Framework
Ajax Basics And Frameworkshivas
 
01 Ajax Intro
01 Ajax Intro01 Ajax Intro
01 Ajax Intro
Dennis Pipper
 

Similar to Ajax (20)

Ajax
AjaxAjax
Ajax
 
Ajax Ppt 1
Ajax Ppt 1Ajax Ppt 1
Ajax Ppt 1
 
Ajax
AjaxAjax
Ajax
 
Ajax
AjaxAjax
Ajax
 
Ajax & Reverse Ajax Presenation
Ajax & Reverse Ajax PresenationAjax & Reverse Ajax Presenation
Ajax & Reverse Ajax Presenation
 
Intoduction to Ajax
Intoduction to AjaxIntoduction to Ajax
Intoduction to Ajax
 
AJAX
AJAXAJAX
AJAX
 
M Ramya
M RamyaM Ramya
M Ramya
 
Asynchronous javascript and xml
Asynchronous javascript and xmlAsynchronous javascript and xml
Asynchronous javascript and xml
 
Ajax ppt
Ajax pptAjax ppt
Ajax ppt
 
Evolution of java script libraries
Evolution of java script librariesEvolution of java script libraries
Evolution of java script libraries
 
Ajax
AjaxAjax
Ajax
 
Ajax
AjaxAjax
Ajax
 
Ajax
Ajax Ajax
Ajax
 
AJAX
AJAXAJAX
AJAX
 
25250716 seminar-on-ajax text
25250716 seminar-on-ajax text25250716 seminar-on-ajax text
25250716 seminar-on-ajax text
 
Ajax assignment help
Ajax assignment helpAjax assignment help
Ajax assignment help
 
Ajax Basics And Framework
Ajax Basics And FrameworkAjax Basics And Framework
Ajax Basics And Framework
 
Ajax
AjaxAjax
Ajax
 
01 Ajax Intro
01 Ajax Intro01 Ajax Intro
01 Ajax Intro
 

More from Tech_MX

Theory of estimation
Theory of estimationTheory of estimation
Theory of estimationTech_MX
 
Templates in C++
Templates in C++Templates in C++
Templates in C++Tech_MX
 
String & its application
String & its applicationString & its application
String & its applicationTech_MX
 
Statistical quality__control_2
Statistical  quality__control_2Statistical  quality__control_2
Statistical quality__control_2Tech_MX
 
Stack data structure
Stack data structureStack data structure
Stack data structureTech_MX
 
Stack Data Structure & It's Application
Stack Data Structure & It's Application Stack Data Structure & It's Application
Stack Data Structure & It's Application Tech_MX
 
Spanning trees & applications
Spanning trees & applicationsSpanning trees & applications
Spanning trees & applicationsTech_MX
 
Set data structure 2
Set data structure 2Set data structure 2
Set data structure 2Tech_MX
 
Set data structure
Set data structure Set data structure
Set data structure Tech_MX
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating SystemTech_MX
 
Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)Tech_MX
 
Motherboard of a pc
Motherboard of a pcMotherboard of a pc
Motherboard of a pcTech_MX
 
More on Lex
More on LexMore on Lex
More on LexTech_MX
 
Merging files (Data Structure)
Merging files (Data Structure)Merging files (Data Structure)
Merging files (Data Structure)Tech_MX
 
Memory dbms
Memory dbmsMemory dbms
Memory dbmsTech_MX
 
Linear regression
Linear regressionLinear regression
Linear regressionTech_MX
 
Keyboard interrupt
Keyboard interruptKeyboard interrupt
Keyboard interruptTech_MX
 

More from Tech_MX (20)

Uid
UidUid
Uid
 
Theory of estimation
Theory of estimationTheory of estimation
Theory of estimation
 
Templates in C++
Templates in C++Templates in C++
Templates in C++
 
String & its application
String & its applicationString & its application
String & its application
 
Statistical quality__control_2
Statistical  quality__control_2Statistical  quality__control_2
Statistical quality__control_2
 
Stack data structure
Stack data structureStack data structure
Stack data structure
 
Stack Data Structure & It's Application
Stack Data Structure & It's Application Stack Data Structure & It's Application
Stack Data Structure & It's Application
 
Spss
SpssSpss
Spss
 
Spanning trees & applications
Spanning trees & applicationsSpanning trees & applications
Spanning trees & applications
 
Set data structure 2
Set data structure 2Set data structure 2
Set data structure 2
 
Set data structure
Set data structure Set data structure
Set data structure
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating System
 
Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)
 
Motherboard of a pc
Motherboard of a pcMotherboard of a pc
Motherboard of a pc
 
More on Lex
More on LexMore on Lex
More on Lex
 
Merging files (Data Structure)
Merging files (Data Structure)Merging files (Data Structure)
Merging files (Data Structure)
 
Memory dbms
Memory dbmsMemory dbms
Memory dbms
 
Linkers
LinkersLinkers
Linkers
 
Linear regression
Linear regressionLinear regression
Linear regression
 
Keyboard interrupt
Keyboard interruptKeyboard interrupt
Keyboard interrupt
 

Recently uploaded

Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
Jen Stirrup
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
UiPathCommunity
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 

Recently uploaded (20)

Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 

Ajax

  • 2. AGENDA • WHAT IS AJAX? • HISTORY • GOOGLE SUGGEST • SIMPLE PROCESSING • COMPONENTS • XHTML,CSS • DOM • XML • HTTP REQUEST OBJECT • JAVA SCRIPT • PROCESS CYCLE • AJAX ADVANTAGES AND DISADVANTAGES • EXAMPLE Page 2
  • 4. AND YOU GET THIS … Page 4
  • 5. THESE DAYS.. Page 5
  • 6. THE MAGIC SPELL BEHIND THIS IS AJAX (Asynchronous JavaScript and XML) Page 6
  • 7. SO WHAT IS AJAX ???  A programming language – no…  A new technology – not exactly…  So what else ? It is a methodology on using several web technologies together, in an effort to close the gap between the usability and interactivity of a desktop application and the ever demanding web application Page 7
  • 8.  Asynchronous Javascript and XML is a client side techniques that combines a set of known technologies in order to create faster and more user friendly web pages.  AJAX provides an ability to communicate with the server asynchronously. ASYNCHRONOUS??? We can send a request to server and continue user interaction with the user with out waiting for server response. Once the response arrives, a designated area in UI will update itself and reflect the response information. Whole page need not be reloaded Page 8
  • 9. HISTORY OF AJAX  Starts with web pages  Static web pages  Static html page is loaded  No interaction with user  Dynamic web pages  Html page is generated dynamically  Interaction with user  Becomes slower as functionality increases  Speed becomes intolerable, so AJAX has been born Page 9
  • 10.  The term AJAX is coined on February 18, 2005, by Jesse James Garret in a short essay published a few days after Google released its Maps application.  In the year 2006, the W3C (World Wide Web Consortium) announces the release of the first draft which made AJAX an official web standard. Page 10
  • 11. GOOGLE SUGGEST Google Suggest is using AJAX to create a very dynamic web interface: When you start typing in Google's search box, a JavaScript sends the letters off to a server and the server returns a list of suggestions. Page 11
  • 12. SİMPLE PROCESSİNG • AJAX is based on Javascript, and the main functionality is to access the web server inside the Javascript code. When user The received We access to the initiates an information is server using event, a javascript shown to the user special objects; we function is called by means of the send data and which accesses Javascript’s retrieve data. server using the functions. objects. Page 12
  • 13. COMPONENTS OF AJAX • Ajax incorporates several technologies, each flourishing in its own right, coming together in powerful new ways. – standards-based presentation using XHTML, CSS – dynamic display and interaction using DOM – data interchange and manipulation using XML – asynchronous data retrieval using XMLHttpRequest – and JavaScript binding everything together. Page 13
  • 14. XHTML, CSS • XHTML stands for EXtensible HyperText Markup Language – It consists of all the elements in HTML 4.01 combined with the syntax of XML • CSS stands for Cascading Style Sheets – It is used to describe the presentation of a document written in HTML or XML. Page 14
  • 15. DOM • Document Object Model for HTML  DOM provides a standard set of objects for representing HTML and XML documents, and a standard interface for accessing and manipulating them.  Essentially, it connects web pages to scripts or programming languages.  It defines an HTML document as a collection of objects that have properties and methods and that can respond to events Page 15
  • 16. XML • EXtensible Markup Language  XML was designed to describe data and to focus on what data is (unlike HTML which was designed to display data and to focus on how data looks)  It is a general-purpose markup language for creating special-purpose markup languages that carry data. Page 16
  • 17. XMLHttpRequest XmlHttp  The kernel of Ajax Request Object  The XMLHttpRequest object allows client-side JavaScript to make HTTP requests (both GET and POST) to the server without reloading pages in the browser.  This JavaScript object was originally introduced in Internet Explorer 5 by Microsoft and it is the enabling technology that allows asynchronous requests Page 17
  • 18. XMLHttpRequest • By performing screen updates on the client, you have a great amount of flexibility when it comes to creating your Web site :  Eliminate page refreshes every time there is user input  Edit data directly in place, without requiring the user to navigate to a new page to edit the data  Increase site performance by reducing the amount of data downloaded from the server • The possibilities are endless! Page 18
  • 19. JavaScript  JavaScript is one of the world's most popular programming languages  Its popularity is due entirely to its role as the scripting language of the WWW along with VBScript  JavaScript has a syntax similar to Java but:  It is not a real programming language (it is script)  It was developed at Netscape and not Sun.  It was originally called LiveScript Page 19
  • 20. JavaScript • JavaScript binds all the mentioned technologies together to create the Ajax “pattern”. When a user clicks a button, you can use JavaScript and XHTML to immediately update the UI Spawn an asynchronous request to the server using the XMLHttpRequest object via JavaScript to perform an update or query a database. When the request returns as XML, you can then use JavaScript, CSS, DOM to update your UI accordingly without refreshing the entire page. Most importantly, users don't even know your code is communicating with the server: the Web site feels like it's instantly responding ("desktop-like" usability) Page 20
  • 21. THE PROCESS CYCLE Page 21
  • 22. BENEFITS OF USING AJAX • Helps to build fast, dynamic websites. • Ajax allows to perform processing on client computer (in JavaScript) with data taken from the server thereby reducing server load by moving a part of server functionality to client side. • Ajax can selectively modify a part of a page displayed by the browser, and update it without the need to reload the whole document with all images, menus etc. This bridges the gap between desktop and web applications. • Saves bandwidth by only transmitting new information • Creates possibility of entirely new types of user interfaces not possible in traditional model. Page 22
  • 23. AJAX DISADVANTAGES  Poor compatibility with very old or obscure browsers, and many mobile devices.  Limited Capabilities like multimedia, interaction with web-cams and printers, local data storage and real time graphics.  Not everyone have JavaScript enabled. If JavaScript is not activated, Ajax can't works. The user must be asked to set JavaScript from within options of the browser, with the "noscript" tag.  Too much code makes the browser slow. Page 23
  • 24. • The back button problem. People think that when they press back button, they will return to the last change they made, but in AJAX this doesn not hold. • Possible network latency problems. People should be given feedback about the processing. • Does not run on all browsers. Page 24
  • 25. XMLHTTPREQUEST OBJECT Important Methods Open(“method”,”url”,boolean)  to send a request to server  method - GET or POST  url - address of the target file  boolean - to denote whether the request is synchronous or asynchronous. If true, asynchronous. Send(content)  to send data to server for processing  content - may be string or DOM type of document. Page 25
  • 26. IMPORTANT PROPERTIES  readystate - used to identify the state of the request. Possible values 0-4.  onreadystatechange - event handler for an event that fires at every state change.  status -Numeric code return by server.Eg.404,200  responseText - the string data returned by the server process.  responseXML - the DOM type of document returned by the server process. Page 26
  • 27. CREATE XMLHTTPREQUEST OBJECT var request; if (window.ActiveXObject) { /*supperted in IE*/ request = new ActiveXObject("Microsoft.XMLHTTP"); } else if (window.XMLHttpRequest) { /* supported in Safari and Mozilla*/ request = new XMLHttpRequest(); } else { request = null; } Page 27
  • 28. CREATE XMLHTTPREQUEST OBJECT request.open("GET", "message.html", true); request.onreadystatechange = function() { if (request.readyState == 4) { if(request.status == 200) { /*in the case of string data*/ var str = request.responseText; document.getElementById(‘tag id’).innerHTML = str ; /*in the case of XML document*/ var response = request.responseXML; var doc = response.documentElement; var data1 = doc.getElementByTagName(‘tagname’)[0].firstchild.nodeValue; } } } request.send(null); Page 28
  • 29. JAVASCRIPT LIBRARY A JavaScript library is a library of pre-written JavaScript which allows for easier development of JavaScript-based applications, especially for AJAX. Some popular javascript libraries are jQuery, MooTools, Prototype, Dojo. With the help of the javascript library functions dynamic web page development will be easier. Page 29
  • 30. THANK YOU… Page 30