jQuery Simplifies Your AJAX/JavaScript Development

jQuery Simplifies Your AJAX/JavaScript Development

wo years ago, I wrote an article for DevX comparing all of the open source AJAX frameworks that were popular at that time. If I were to write the same article today, my framework of choice would be a library that was not even on my list in 2006. In 2008, jQuery would be the framework I choose. Some informal research revealed that I’m not alone; jQuery seems to be on its way to becoming the most popular of all AJAX frameworks.

The following are the main characteristics responsible for jQuery becoming such a popular choice among developers:

  • Simple programming model
  • Simplicity and straightforwardness
  • Basic and essential expressions/conventions requirements

To give you a sense of jQuery’s simplicity, this jQuery code sample executes an AJAX call to the backend server:

$.get( "sample.jsp", responseHandler )

As you can see, this very simple line of code is?even to users unfamiliar with jQuery?simple to understand. It contains one, appropriately named method that handles invocation of the remote service, including all of the underlying details of the cross-browser, compatible asynchronous processing (more on this later). This article provides a comprehensive introduction to this simple, yet powerful, AJAX framework.

Integration of Web Standards and Promotion of the Best Design Practices
jQuery provides native support and recognition for HTML and CSS symbols and terminology. Take a look at the syntax for changing the CSS property of a div with the ID of sampleDiv:

$("#sampleDiv").css("margin-top", "35px;");

In addition, jQuery keeps its custom code in external JavaScript files and away from the content, promoting the separation of code from content. From a design and implementation perspective, this emphasis makes jQuery a smart choice for implementing web applications in a maintainable way.

jQuery Is Well Documented and Extensible
Besides the excellent documentation available on jQuery's project web site, numerous online references and 'how to' sites are devoted to jQuery, including an original and valuable third-party web site called Visual jQuery. You will also find a number of excellent books on jQuery. One that I particularly like is jQuery in Action.

The core jQuery library also is extensible. Third-party software developers contribute jQuery plugins, many of which are extremely valuable extensions. For example, jQuery drag-n-drop is a high-quality add-on that further enhances the value of jQuery.

Installing jQuery
The jQuery JavaScript library is available for download in a "minified" (names of the variables and functions are minimized for size) compressed or uncompressed JavaScript file. Download the latest version and install it on your web page as: