AJAX Made Easy - Learn AJAX
AJAX Home Learn-AJAX

Ajax and JavaScript

 Category: Learn AJAX Add Comment





Introduction

Ajax is a combination of technologies that increase web page usability. It is an acronym for Asynchronous JavaScript and XML. Ajax performs its functions by encoding all requests between the server and the browser in the common programming language of JavaScript. Communication between server and browser in a standardized language like JavaScript and the Ajax XMLHttpRequest object allow for page updates to occur asynchronously through remote scripting. That is, relevant parts of web applications can be updated onto the web page interface ‘behind the scenes’ without requiring the user to re-load the entire page.

This makes for a faster, more comprehensive, and more interactive user experience. JavaScript provides a language for remote scripting. Remote scripting lets users request (for Ajax, in JavaScript) data from the server through their web browser without refreshing the entire page. Ajax, however, performs several other functions that make for a seamless web experience. These other functions require the manipulation of the DOM (Direct Object Model). For example, XHTML (Extensible Hypertext Markup Language) and CSS (Cascading Style Sheets) mark up and style the web pages.

Marking up refers to any data that further describes the content. Style refers to layout, fonts, colors, picture placement, and other aesthetic elements. XML provides a format through which to exchange data between the server and the browser. However, most important for accessing and altering the DOM is a client-side scripting language, which JavaScript is, that allows for easy interaction with the information.

This article will discuss Ajax’s reliance on JavaScript.


Background

JavaScript was developed in 1995 to support the use of Java “applets” for non-Java programmers and web designers. “Applets” are small applications that are written in Java. They are imbedded in HTML pages (web pages) and facilitate functions such as scrolling in specific areas and animation. They are independent of operating systems and, therefore ,are easily translatable. They are Internet programs and easily downloadable by any computer. JavaScript is a script language created by Netscape. Script languages include sets of programming codes and JavaScript, in particular, is useful to web page functionality because in can be easily incorporated into HTML documents.

JavaScript’s primary aim was to develop interactive web sites and Ajax methodologies were developed to improve web experience. The centrality of JavaScript in the Ajax name is just one the clues regarding its importance to cutting edge web development.

The term Ajax was first coined in 2005. As previously stated, it describes a set of technologies that collaborated to improve web usability. Interestingly, Ajax does not describe any new technology, but rather the strategic positioning of already existing technologies to work together in new ways.

For example, JavaScript was developed to address early web development issues. Microsoft’s development in remote scripting, MSRS (1998) allowed for Java applets to be utilized with the client communicating in JavaScript. This method worked on Internet Explorer and Netscape, version 4, from the late 90’s onwards. Microsoft introduced the XMLHttpRequest object on Internet Explorer, version 5 (1999). This was one of the innovations that would lead to the coining of Ajax. For example, in 2002 MSRS replaced Java applets with XMLHttpRequest objects central to the Ajax approach.

This expanded interoperability across web platforms. However, JavaScript is still the primary language for web development and Ajax techniques. It is JavaScript’s coupling with other specific technologies, like XMLHttpRequest, that incorporate it into an Ajax engine.


Uses

Perhaps the most powerful innovation of Ajax technology is situating JavaScript in the browser. Through this, JavaScript is connected to and connects all the components of a web page. Within an Ajax framework it means that JavaScript can manipulate characteristics of an HTML page through the DOM. JavaScript can also manipulate the DOM elements that control the visual aspects of a web page the CSS.

CSSs separate web page presentation from content. One of JavaScript’s primary features is the ability to respond to events in time. In conjunction with other Ajax technologies, this feature can create interactive web features like the mouseover, where text pops up or the HTML (and web page appearance) change when a user’s mouse rolls over a button with the attached function (written, of course, in JavaScript). XMLHttpRequest allows for asynchronous data retrieval, but it is JavaScript that encodes that request with its own thread of implementation so that normal browser ability can be maintained while the request is being processed. Like its position in the acronym, JavaScript is central to all Ajax functions.


Points of Interest

Unfortunately, the centrality of JavaScript within the Ajax framework is also one of Ajax’s primary disadvantages. For example, different browsers can install JavaScript differently. This may require JavaScript to be tested for compatibility in multiple browsers.

Ultimately, however, Java technology is compatible with Ajax and Web sites employing Ajax techniques. JavaScript is encapsulated by Ajax technologies, like XMLHttpRequest, so that the server does all the work of translating and implementing coded requests.






Next: Ajax vs Flash



Post Comment


You need to Login to post your comment...

Click here to login

Title:
 
Comment:



Daily Email Updates

AJAX Updates delivered directly to your Inbox...

Enter your email address:

Latest AJAXwith Updates

Related AJAX Articles

Popular AJAX Articles