What is AJAX ?
Auto completion
A specific portion of form data may be auto-completed as the user
types.
Sophisticated UI Controls
Controls such as tree controls, menus, and progress bars may be
provided without page refreshes.
So
Better User Experience
AJAX
1 3
browser server-side systems
2
http request data
web stores
UI
server backend
4 html + css data etc.
5
Data is returned
Browser replaces view in response to
with data sent from the request
server
browser
request
UI HTML
HTML/ /CSS
CSS
data
data data
other
other
data
data (e.g.
(e.g.
images)
images)
Data Stores. Browser knows how to
save and manage data it downloads.
JavaScript programs, via the engine, can access and modify the HTML /
CSS data, dynamically changing the UI that’s displayed.
browser request
XMLHttpRequest()
JavaScript Engine
JavaScript
HTML rendering engine
programs can
now go off and
“do their own
thing,” including HTML XML JavaScript
UI HTML/ /CSS
CSS XML JavaScript
getting data data data code
data data code
from elsewhere,
data
without waiting
for the user to other
other
do something! data
data (e.g.
(e.g.
images)
images)
XML data support. Browsers can now store XML data, and access / manipulate
from JavaScript programs via the JavaScript engine.
AJAX : The Next Generation of Web Applications
AJAX Changed it !
Browser user activity user activity User activity
UI
Response
Response
Request
Request
Ajax:
time
Server-side
Server-side
server processing
Frequency Div id
<form>
First Name: <input type="text" id="txt1"
onkeyup= “ showHint(this.value) “ >
</form>
<p>
Suggestions: <span id= “ txtHint “ >
</span>
</p>
Server
Database
Frequency <div
Not aid=status
Valid Name>
Client/Browser
Could do it custom, but there are some libraries / tools to help you do this.
These have pre-built code that makes life much simpler by:
providing a toolkit of functions (in JavaScript) that perform key
browser/Ajax functions or patterns of behavior
supporting multiple browsers (i.e. have built-in workarounds for
differences between Internet Explorer 5/6/7, Firefox 1.0/1.5/1.7, others
There are also servers / application ‘frameworks’ that support Ajax within a
server/application building environment. For example:
ATLAS (for .NET)
AJAX-JSF (Java)
Cajax (PHP)
Viel mehr als nur Dokumente.
Entdecken, was Scribd alles zu bieten hat, inklusive Bücher und Hörbücher von großen Verlagen.
Jederzeit kündbar.