An Introduction To AJAX
Document Sample


Briefing-43 Briefing-43
An Introduction An Introduction
To AJAX To AJAX
UKOLN: Supporting The Cultural Heritage Sector UKOLN: Supporting The Cultural Heritage Sector
What Is AJAX? What Is AJAX?
AJAX (Asynchronous JavaScript and XML) is “a group of interrelated Web AJAX (Asynchronous JavaScript and XML) is “a group of interrelated Web
development techniques used to create interactive web applications or rich Internet development techniques used to create interactive web applications or rich Internet
applications” [1]. Using AJAX it is possible to develop Web applications which have a applications” [1]. Using AJAX it is possible to develop Web applications which have a
rich user interface which can approach the usability of well-written desktop application. rich user interface which can approach the usability of well-written desktop application.
The Origins of AJAX The Origins of AJAX
The key technical components of AJAX are: The key technical components of AJAX are:
XHTML – a stricter, cleaner rendering of HTML into XML. XHTML – a stricter, cleaner rendering of HTML into XML.
CSS for marking up and adding styles. CSS for marking up and adding styles.
The Javascript Document Object Model (DOM) which allows the content, The Javascript Document Object Model (DOM) which allows the content,
structure and style of a document to be dynamically accessed and updated. structure and style of a document to be dynamically accessed and updated.
The XMLHttpRequest object which exchanges data asynchronously with the The XMLHttpRequest object which exchanges data asynchronously with the
Web server reducing the need to continually fetch resources from the server. Web server reducing the need to continually fetch resources from the server.
Since data can be sent and retrieved without requiring the user to reload an entire Web Since data can be sent and retrieved without requiring the user to reload an entire Web
page, small amounts of data can be transferred as and when required. Moreover, page page, small amounts of data can be transferred as and when required. Moreover, page
elements can be dynamically refreshed at any level of granularity to reflect this. An elements can be dynamically refreshed at any level of granularity to reflect this. An
AJAX application performs in a similar way to local applications residing on a user’s AJAX application performs in a similar way to local applications residing on a user’s
machine, resulting in a user experience that may differ from traditional Web browsing. machine, resulting in a user experience that may differ from traditional Web browsing.
Examples of AJAX usage include GMail and Flickr. It is largely due to these and other Examples of AJAX usage include GMail and Flickr. It is largely due to these and other
prominent sites that AJAX has become popular only relatively recently – the technology prominent sites that AJAX has become popular only relatively recently – the technology
has been available for some time. One precursor was dynamic HTML (DHTML), which has been available for some time. One precursor was dynamic HTML (DHTML), which
twinned HTML with CSS and JavaScript but suffered from cross-browser compatibility twinned HTML with CSS and JavaScript but suffered from cross-browser compatibility
issues. issues.
AJAX is not a technology, rather, the term refers to a proposed set of methods using a AJAX is not a technology, rather, the term refers to a proposed set of methods using a
number of existing technologies. As yet, there is no firm AJAX standard, although the number of existing technologies. As yet, there is no firm AJAX standard, although the
recent establishment of the Open AJAX Alliance [2], supported by major industry recent establishment of the Open AJAX Alliance [2], supported by major industry
figures such as IBM and Google, suggests that one will become available soon. figures such as IBM and Google, suggests that one will become available soon.
This document is available at: This document is available at:
<http://www.ukoln.ac.uk/cultural-heritage/documents/briefing-43/> <http://www.ukoln.ac.uk/cultural-heritage/documents/briefing-43/>
Developing AJAX Applications Developing AJAX Applications
AJAX applications can benefit both the user and the developer. Web applications can AJAX applications can benefit both the user and the developer. Web applications can
respond much more quickly to many types of user interaction and avoid repeatedly respond much more quickly to many types of user interaction and avoid repeatedly
sending unchanged information across the network. Also, because AJAX technologies sending unchanged information across the network. Also, because AJAX technologies
are open, they are supported in all JavaScript-enabled browsers, regardless of operating are open, they are supported in all JavaScript-enabled browsers, regardless of operating
system – however, implementation differences between browsers cause some issues, system – however, implementation differences between browsers cause some issues,
some using an ActiveX object, others providing a native implementation. some using an ActiveX object, others providing a native implementation.
Although the techniques within AJAX are relatively mature, the overall approach is still Although the techniques within AJAX are relatively mature, the overall approach is still
fairly new and there has been criticism of the usability of its applications; further fairly new and there has been criticism of the usability of its applications; further
information on this subject is available in the Usability Issues For AJAX briefing information on this subject is available in the AJAX and Usability briefing document
document [3]. [3].
Advantages and Disadvantages of AJAX Advantages and Disadvantages of AJAX
As described in Wikipedia advantages provided by use of AJAX include: As described in Wikipedia advantages provided by use of AJAX include:
• State can be maintained throughout a Web site. • State can be maintained throughout a Web site.
• A Web application can request only the content that needs to be updated, thus • A Web application can request only the content that needs to be updated, thus
drastically reducing bandwidth usage and load time. drastically reducing bandwidth usage and load time.
• Users may perceive an AJAX-enabled application to be faster or more responsive. • Users may perceive an AJAX-enabled application to be faster or more responsive.
• Use of Ajax can reduce connections to the server, since scripts and style sheets • Use of Ajax can reduce connections to the server, since scripts and style sheets
only have to be requested once. only have to be requested once.
The disadvantages include: The disadvantages include:
• Clicking the browser's "back" button may not function as expected. • Clicking the browser's "back" button may not function as expected.
• Dynamic Web page updates make it difficult for a user to use bookmarks. • Dynamic Web page updates make it difficult for a user to use bookmarks.
• Browser does not support JavaScript or have JavaScript disabled, will not be able • Browser does not support JavaScript or have JavaScript disabled, will not be able
to use its functionality. to use its functionality.
• AJAX may provide a mechanism for attacks by malicious code. • AJAX may provide a mechanism for attacks by malicious code.
References References
1 AJAX (programming), Wikipedia, 1 AJAX (programming), Wikipedia,
<http://en.wikipedia.org/wiki/Ajax_(programming)> <http://en.wikipedia.org/wiki/Ajax_(programming)>
2 The Open AJAX Alliance, <http://www.openajax.org/overview.php> 2 The Open AJAX Alliance, <http://www.openajax.org/overview.php>
3 Usability Issues For AJAX, Cultural Heritage briefing document no. 20, UKOLN, 3 Usability Issues For AJAX, Cultural Heritage briefing document no. 20, UKOLN,
<http://www.ukoln.ac.uk/cultural-heritage/documents/briefing-20/> <http://www.ukoln.ac.uk/cultural-heritage/documents/briefing-20/>
Produced by UKOLN: a national centre of expertise in digital information management Apr 2009 Produced by UKOLN: a national centre of expertise in digital information management Apr 2009
For further information see <http://www.ukoln.ac.uk/> For further information see <http://www.ukoln.ac.uk/>
Related docs
Get documents about "