MooTools v/s jQuery

MooTools v/s jQuery is a hot topic as with the advent of technology every developer is using JavaScript in one way or another. Picking up a library is not an easy task specially if you are working somewhere where they already have a set pattern or their libraries defined. Ideally, every company is either working with Moo Tools or jQuery based on their past experiences or developement expertise. Although, both of the This article will bring some of the points to your notice before choosing between Moo Tools or jQuery as your library.

Apart from Moo Tools and jQuery there are other frameworks too which are used quite extensively like Dojo, Ext, YUI and Prototype. But, we are not going much into these framework at this moment and will only consider Mootools and jQuery. I will write an analysis covering all the JavaScript framework later.

Ease Of Learning

jQuery is quite easy to learn and has a good community support. If you are not a JavaScript freak still jQuery will be easier to learn and accomplish things where Moo Tools will require you to spend more time. In one line we can say that learning curve will be steep in Moo Tools than jQuery. In terms of community support, availability of books, search queries on Google its clearly evident that jQuery is leading the race with huge margin. Why jQuery is more popular? We can say just because of the learning ease, excellent documentation and active promotion of jQuery library.

DOM & Pure JavaScript

When we want to work only with DOM (Where 99% of all JavaScript runs) jQuery is far superior than Moo Tools. One reason why jQuery is so popular because of the reason that it does not expects you be learn JavaScript inside out. You are not required to think through prototypal inheritance, binding, “this”, and native prototypes. But, when we think in terms of JavaScript in full breadth we will notice that jQuery is simply focusing on DOM only. jQuery doesn’t address inheritance, basic utilities of all the native types in the JavaScript language etc. Still, if you want to do these you have to write your own stuff. jQuery makes the DOM your playground, but the rest of JavaScript is just not in its scope.

Moo Tools on the other hand is quite different and covers entire JavaScript language not just DOM. This is one of the reason of Moo Tools being bit hard for the early developers. Because MooTools focuses on making the JavaScript API itself more stable and coherent, it is focused less on giving you an interface that “changes the way you write JavaScript” and more on making JavaScript as a whole less frustrating; MooTools is an extension to the JavaScript language. MooTools tries to make JavaScript the way it is meant to be. A significant portion of the core library is spent on augmenting Function, String, Array, Number, Element and other prototypes. The other big thing it offers is a function called Class.

jQuery does not offer an inheritance system nor does it offer any enhancements to native objects (Function, String, etc). This is not a deficiency of jQuery as the authors of jQuery could easily offer these things. Rather, they have designed a toolkit with a different goal in mind. Where MooTools aims to make JavaScript more fun, jQuery aims to make the DOM more fun and its designers have chosen to limit their scope to that task.

In broader way we can say that everything you can do in jQuery can be done in Moo Tools but there is no way to emulate stuff done in Moo Tools into jQuery code because of jQuery’s focus on the DOM. MooTools has a broader functionality than jQuery, but there’s nothing about jQuery that prevents you from doing those things.

jQuery focuses on expressiveness, quick and easy coding, and the DOM while MooTools focuses on extension, inheritance, legibility, reuse, and maintainability.

Further, the MooTools core does not contain every feature you can imagine and neither does the jQuery core. Both frameworks keep their cores rather lean, leaving it to you and others to write plug-ins and extensions. Their job is not to give you every feature you could want but to give you the tools so that you can implement anything you can imagine. This is the power of JavaScript, and of JavaScript frameworks in general, and both frameworks excel at it. MooTools takes a more holistic approach and gives you tools to write anything you can imagine beyond the scope of the DOM, but pays the price by having a steeper learning curve. MooTools extensibility and holistic approach gives you a superset of jQuery’s features, but jQuery’s focus on a slick DOM API doesn’t preclude you from using the native inheritance methods of JavaScript or from using a class system like MooTools if you want it.

Slickspeed is a small analytical approach to benchmark the performance of JS frameworks. If you’ve got any thoughts, comments or suggestions for things we could add, leave a comment! Also please Subscribe to our RSS for latest tips, tricks and examples on cutting edge stuff.

Working with Adobe Spry: An Ajax framework

Adobe Spry is an Ajax framework developed for Web designers, making it possible to create a richer experience on an HTML page. Spry is intended to be a way of easily implementing Ajax – designers with entry level HTML, CSS and JavaScript experience should find Spry an easy way to integrate content. Spry differs from other Ajax frameworks because it has been created for designers rather than developers. It is less reliant on server-side technology compared to some other Ajax frameworks; instead it relies on XML, which is easily consumed by Spry’s components with a minimum of fuss.

In its attempt to make the implementation of Spry simple, Adobe has drawn some fire from Web standards adherents with criticism that it makes use of custom HTML attributes.

Adobe released an updated version, Spry 1.5, recently on its Adobe Labs site; this is the sixth release since the original beta last year with new features added for interacting with different kinds of data including:

  • Nested Data Sets
  • JSON Data Sets
  • HTML Data Sets
  • Session Handling
  • Form Submission
  • Paged Data View
  • Rewrite of existing Effects
  • Radio Button Validation Widget
  • Auto Suggest Widget
  • Spry API

The Spry framework contains the following components:

  • Spry Data and Dynamic Region
  • Data Utilities
  • Server Side Utilities
  • Widgets
  • Effects

Spry is a free download from Adobe, included in the download is a multitude of demos, samples, articles and documentation. Documentation is also available online via Adobe’s LiveDocs, there is also a developer centre for Spry where you can find numerous articles already available.

Working With Data

XML Data

Enough talk; let’s put the framework to the test. The first thing that we evaluated was Spry’s ability to handle XML data. We created some sample data in the form of an XML file with the details for the employees of a fictitious municipality. A sample below:

You can see that the data has multiple rows each with the same properties, there’s no DTD (Data Type Definition) required by Spry to interact with XML, which is typically a problem of consuming XML — no standardization. The goal here is to have Spry handle data for us and output that in an HTML page, you nominate the attributes and properties from the data and tell Spry where on the page to display them.

Using a text editor we’ll work on the HTML content. Below is a snippet from between the tags. I’ve imported two .js files, the first uses Google’s open source code to utilize XPath so that we can filter data later on, the second is the Spry data library — it’s dependant on the XPath library which is why the other is declared first.

Next an instance of the Spry XMLDataSet is declared; here we’ve called it dsEmployees. The instantiation requires two parameters: the location of the XML file and an XPath expression that identifies the XML node or nodes that the data is contained within. The XML can also be loaded from a URL. Note that the XPath expression identifies the XML root node then the name of the child node that represents each row of data.

Outputting the Spry data set within the body of the page is simple. Spry dynamic regions are used to display XML data on the page; they update themselves when the data set changes. A dynamic region is declared within a div tag using spry:region, HTML tags then are used as dynamic region containers. The region is an “observer” of the Spry data set, curly braces are used to identify columns from the data set, the spry:repeat tag iterates through the data set displaying all the rows.

DepartmentEmail
{department}{email}

Name
{fname} {lname}

 

Spry has provisions to do master/detail dynamic regions from one or more sets of data. The sample code below uses the same logic within the head tag to declare a Spry data set as above. An onclick event has been added to the repeated table row that links to a Spry XMLDataSet method called setCurrentRow passing the id of the current row as parameter. The second table is surrounded with a div that uses the spry:detailregion to populate the detail portion of the code. Sorting table data by column headings is just as easy.

Name
{fname} {lname}

 

 

DepartmentEmailMobile Phone
{department}{email}{mobilePhone}

Name
{fname} {lname}

 

Leave me a comment and let me hear your opinion. If you’ve got any thoughts, comments or suggestions for things we could add, leave a comment! Also please Subscribe to our RSS for latest tips, tricks and examples on cutting edge stuff.

AJAX should not mandate HTTP

What if you are using AJAX requests in application but your server is offline for some reasons? An interesting and unfortunate by-product of AJAX applications is that these applications rely upon the existence of an application server always being available.

Many Web users are used to the idea that they can save a Web page to be read at their convenience. Even when there is Flash on the page, the page still works offline. After all, HTML is simply a document storage format, and HTTP is simply a protocol designed to optimally transmit HTML documents. But, in reality, more and more Web developers are assuming that the user will not want to save the Web page or lose network connectivity. I think that this is a mistake.

A lot of frameworks have come out recently that are designed to tackle the offline problem; the frameworks’ approach is usually to run a database on the client. The database can cache data from the “home server”, and if the user makes changes while offline, that database can write the changes back to the “home server” when it becomes available again. These frameworks don’t do anything about all of the back and forth requests to the app server that AJAX applications generate.

Some developers try to tackle this problem by loading a miniature application server on the client via Java (or similar “applet” style technologies). This approach works. However, after a certain point, I wonder how many hoops someone needs to jump through to compensate for an inherent shortcoming of a particular technique before it becomes clear that a technique might not meet their needs.

Even assuming that you can put a miniature application server and database server on the client that can cache and sync with the master servers whenever possible, you still have not solved the problem of “saving a Web page”. The user doesn’t think they are using an “application”; if it runs in a Web browser, they treat it like a Web page. Users are always clicking the Back button (which messes up AJAX apps) because they expect it to work like the Undo button. And incidentally, it does work like the Undo button in a more traditional step-by-step forms-based application. Ironically, one of the biggest issues that AJAX addresses in traditional Web development is the stateless nature of the HTTP protocol — and yet it suffers from its own lack of state.

Let’s take a “product finder” application as an example. In the application, the user selects various options as “must have” and “nice to have” features. Some of these are Boolean selections, while others might be numeric ranges, and one or two might be “one-of-many” or “many-of-many” options. Now, let’s imagine that our user has narrowed her choices down to four products from the original 50. She decided to save the Web page to disk so she can email it to her boss or co-workers for review. Whoops! Her boss and co-workers will likely have a problem if they try to bookmark the page or email the link. In a traditional Web application, if the developer is smart, he or she will use GET rather than POST for these scenarios to ensure that the link accurately represents the application’s state, and the page is quite easily saved in its current state.

I am not saying that AJAX applications cannot function like this; however, until users get used to the idea that the traditional model no longer applies, developers will want to find smart and creative ways of addressing this issue. One way of doing this would be to periodically “tag” the state with a hash code and redirect the browser to a URL that calls that hash code. This way, if the user hits the Back button, she goes back, say, two minutes in time (or 10 operations) rather than back to the beginning. Also, the user can email (or bookmark) that link. Developers often build in Email This Page, Bookmark This Page, or even Save This Page buttons on their site, but it takes effort to build in the buttons, and users often miss those buttons or assume that they do the same thing as the similarly labelled browser functions.

I think that developers who work hard can find some creative, workable, and usable solutions for this issue, and their users will appreciate it.

Please post your valuable comments if you like to share your experiences with us. If you like this post kindly subscribe to our RSS for free updates and articles delivered to you.

PHP AJAX Framework & Libraries

To deliver powerful web application using PHP AJAX development framework for developing new generation Web 2.0 applications you can use PHP Frameworks. There are various PHP AJAX Frameworks available for use, few are FREE and some are with commercial licence. You can choose any of them based on your requirements.

1. GWTPHP – It is very powerful web application framework which allows you to write AJAX Web 2.0 applications in Java, with backend powered by object oriented PHP 5. Its not yet released and will be available for developers by November.

GWT Php Framework

Features

  • Write on Java, compile for all browsers with GWT
  • Develop quickly and effectively with modern, object oriented languages
  • Support for skinnable applications and theming
  • Compatible with standard shared hosting accounts
  • Add publicable API and support for plugins and gadgets to your application
  • Ability to develop multi-lingual applications

2. AjaxAC – It is an open-source framework written in PHP, used to develop/create/generate AJAX applications. The fundamental idea behind AJAX (Asynchronous JavaScript And XML) is to use the XMLHttpRequest object to change a web page state using background HTTP sub-requests without reloading the entire page.

Features

  • All application code is self-contained in a single class (plus any additional JavaScript libraries)
  • Calling PHP file / HTML page is very clean. All that is required is creating of the application class, then referencing the application JavaScript and attaching any required HTML elements to the application.
  • Built in functionality for easily handling JavaScript events
  • Built in functionality for creating subrequests and handling them
  • Allows for custom configuration values, so certain elements can be set at run time
  • No messy JavaScript code clogging up the calling HTML code – all events are dynamically attached
  • Easy to integrate with templating engine due two above 2 reasons
  • Easy to hook in to existing PHP classes or MySQL database for returning data from subrequests
  • Extensible widget structure to be able to easily create further JavaScript objects (this needs a bit of work though)

3. tppAJAX – tppAJAX is a lightweight, yet feature-rich PHP and Ajax toolkit that is compatible with PHP versions 4 and 5 (PHP 5.2 required for JSON)

tppAjax.jpg

Features

  • New feature! Send data back to your script using JSON!
  • Built in JSON XSS protection!
  • Works in the newest browsers from Microsoft and Mozilla and in Linux web browsers too!
  • tppAJAX supports true form submissions – variables available in $_POST using PHP
  • Includes robust Javascript interface to the xmlHttpRequest object
  • Lightweight easy-to-use PHP code generates output for Ajax interactions
  • Architecture encourages business logic to remain on the server not where hackers can see it.
  • Multiple connections can be communicating at any one time with connection pooling!

4. Akelos PHP Framework – The Akelos PHP Framework is a web application development platform based on the MVC (Model View Controller) design pattern. Your Akelos based applications can run on most shared hosting service providers since Akelos only requires that PHP be available at the server.

akelos-php-framework.jpg

  • Write views using Ajax easily
  • Control requests and responses through a controller
  • Manage internationalized applications
  • Communicate models and the database using simple conventions.

5. aSSL – It is a library that implements a technology similar to SSL without HTTPS. aSSL enables the client to negotiate a secret random 128-bit key with the server using the RSA algorithm. Once the connection has been established, the data will be sent and received using AES algorithm.

aSSL_logo.gif

6. Cross Browser AJAX – Cross Browser Ajax (CBA) is a tiny, fast, and truly cross browser library that makes adding AJAX features to your pages very easy.

cba.gif

Features

  • Works with IE5.0+ ( even with disabled ActiveX ), Mozilla 1.7+, Firefox 1.0+, Opera 7+, Safari
  • Small size. 2.5Kb compressed
  • Data can be loaded from different host.
  • Easy-to-Use
  • see AJAX Tab Demo

7. DutchPIPE – It is a PHP object-oriented framework to turn sites into real-time, multi-user virtual environments. Each web page becomes an abstracted environment or location where visitors and other items on the page are visualized. This status is retained as visitors move around. A lot of real-time interaction is possible. The result: Persistent Interactive Page Environments. DutchPIPE uses AJAX and the DOM for the browser – it works without Java, Flash, plug-in or firewall adjustments. On the server, PHP 5 is used.

dutchpipe.gif

Features

  • Multilingual support
  • Make easy-to-use product and shopping cart pages. Have automated and/or real person site assistants stand by to assist your customers and increase sales.
  • Developers program “world” objects in PHP – No Javascript coding required
  • Open source license (MIT)

8. NanoAjax – The NanoAjax Framework is a PHP (Version 5.x.x and above) based, AJAX object oriented framework, which helps to fast realize complex web-applications. The easy interface profides a fast and reliable way to implement your own AJAX applications. It uses JSON (Javascript Object Notation) to encode/decode data between server and browser; Multiple (virtual) requests can be summarized into one (real) AJAX request

nanoajax_framework.jpg

Features

  • packaging multiple (virtual) requests in one real AJAX request
  • adjusted for developers (knowledge about PHP and medium JavaScript is required)
  • small, fast and easy to use
  • class based handler for server-side events (class + method)
  • uses full compact JSON for data transfer [client->server; server->client]
  • PHP 5 object oriented programming (OOP) [used Design Patterns: Registry, Strategy, Factory, and more]
  • automatic use of internal PEAR JSON Extension or ultra-fast PHP JSON Extension (if installed)
  • Server-Side (PHP) straight unit-tested (with PHPUnit 3 and Phing for visual display, incl. code-coverage)
  • Open-Source license (GPL)

9. PHPLiveX – It is a php class library which can be used to call PHP functions from Javascript in web pages using AJAX

plx_logo.gif

Features

  • Very easy-to-use
  • Lightweight one class library that doesn’t slow the page
  • No need to do many things to call a php function via javascript
  • Class methods can be ajaxified
  • Useful and easy-to-use properties like preloading, form submission
  • Simple but useful event and error handling
  • Compatible with IE, Opera, Mozilla, Firefox
  • Open source (developed under LGPL license)

10. Qcodo -It is is a PHP-based MVC, code-generation framework. The framework consists of two main components: the Code Generator and Qforms (see below for more). While the framework was designed to support the complexities of large projects, it is an incredibly lightweight framework which can be utilized by small and large web applications alike.

codegen.png

Features

  • Completely object-oriented, stateful, event-driven architecture for HTML forms processing and rendering – completely separates code and display HTML.
  • QForms and QControl libraries provide low-code AJAX support
  • Open-source (MIT license) by multiple contributors, Mike Ho and QuasIdea Development are primary developer & sponsor.

11. Symfony – Symfony is a very popular full-stack framework, a library of cohesive classes written in PHP5. It provides an architecture, components and tools for developers to build complex web applications faster. Choosing symfony allows you to release your applications earlier, host and scale them without problem, and maintain them over time with no surprise.

symfony.gif

Features

  • simple templating and helpers
  • cache management
  • smart URLs
  • scaffolding
  • multilingualism and I18N support
  • object model and MVC separation
  • Ajax support
  • enterprise ready

12. phpwebbuilder – It is an object-oriented framework for building web applications in PHP. It supports AJAX transparently, MVC, and object persistency (with automatic database generation)

13. Tigermouse – It is object oriented, LGPL licensed PHP/AJAX framework for development of highly interactive web applications in MVC architecture. Its main principle is to be as much client side processing independent as it is possible to provide high reliability and stability. It requires no to little Javascript coding, no manual callbacks handling and no configuration.

tigermouse_logo.png

Features

  • full native AJAX support with queuing and expiring
  • MVC architecture
  • pluggable input/output filters
  • powerful ActiveRecord implementation
  • SWT-, Qt- or GTK#-like user interface implementation
  • extensible i18n support
  • native support for Smarty templates
  • built-in development tools

There are few others available also, i am going to have a look at all of them and update this list. Please post your valuable comments if you like to share your experiences with the above list. If you like this post kindly subscribe to our RSS for free updates and articles delivered to you.

Free PHP-AJAX Chat applications

Chat  applications are very common in social networking sites, dating sites and other web applications where you need your users to interact with each other or even to site admin. Previously, there were many PHP chat applications which needed page refreshing annoying the users. Then came AJAX chat applications which doesn’t need page refresh and looks very similiar like any flash chat applications. Following is a list of PHP AJAX chat applications you can use in your web applicaitons for free.

  • AJAX Chat is a free and fully customizable open source web chat software implemented in JavaScript, PHP and MySQL. Sound support is implemented using Flash, Socket support using Flash on client-side and Ruby on server-side. AJAX Chat integrates nicely with phpBB, MyBB, PunBB, SMF, vBulletin and other PHP community software. View Demo
  • phpFreeChat is a free, simple to install, fast, customizable and multi languages chat that uses a simple filesystem for message and nickname storage. It uses AJAX to smoothly refresh (no flicker) and display the chat zone and the nickname zone. It supports multi-rooms (/join), private messages, moderation (/kick, /ban), customized themes based on CSS and plugins systems that allows you to write your own storage routines (ex: Mysql, IRC backends …), and you own chat commands. View Demo
  • Mia Chat is an Ajaxed PHP chat application which is very simple to use & install. It functions similar to the messenger applications, you can add buddies, chat with several users at the same time, change your online status & more. View Demo
  • AJAX-IM is a browser-based instant messaging client. It uses AJAX to create a near real-time IM environment that can be used in conjunction with community, intranet, and social websites. No refreshing of the page is ever needed for this “web application” to work, as everything is updated in real-time via JavaScript. view demo username: “test” ,  password: “test”.
    ajax_im.gif
  • Blogoscoped is avatar based ajax chat application built in PHP. This chat program doesn’t need any special plug-in (like Java or Flash) but simply runs in your browser. It was tested with Internet Explorer 6, Firefox 1, and to some degree Konqueror.
  • Chatr is a chatroom on your site. It’s a set of php scripts and some javascript to create an AJAX/php chatroom with php as the only server requirement. It has two skin support. view demo
    chatr.gif
  • AJAX Chat is a simple productive an light weight chat application which can be used in your PHP applications.
  • toksta is a free instant messenger, which is easy to implement and customize into your social networking site or forum. toksta* IM enables your users to chat via text chat or webcam in real time – without having to switch to programs like Skype, MSN or ICQ!
    It is a hosted application that can be integrated to your website & user database. With this feature, your users won’t have to re-login to the messenger. toksta* also provides plug-ins for phpBB2, phpBB3, punBB, phpMyForum and vBulletin.
    free_webcam_chat.jpg
  • firefly is a totally different chat system which can power your websites by adding a line of JavaScript, your visitors can chat with each other in an overlayed screen.
    javascript_chat.jpg

All the above chat applications are for free but please read their terms and conditions before use in commercial applications.

Shout me your experiences with the above applications their pros and cons. If you like this post kindly subscribe to our RSS for free updates and articles.

14 AJAX, JavaScript & DHTML Datagrids

When we have to present our data in a systematic fashion we have to exhibit in Datagrid style. Table is an ideal example of a well-structured data presentation, which is easy to evaluate and easy to handle. Used for its original purpose – to present data, not to style it -, it can convey ideas effectively. And this is what most of us are actually trying to achieve in the Web.

Furthermore, the user experience can be immensely improved with optional functionalities – such as sorting, filtering and fast editing.

Following are 14 most popular AJAX, JavaScript & DHTML Datagrids which you can use in your application. Please check the user agreement before you download and use them in your application.

  1. ExtJs Grid with Expander Rows, Collapse and Force Fit, Framed with Checkbox Selection and Horizontal Scrolling as well as standard Panel features such as framing, buttons and toolbars. ExtJs Grid
  2. dhtmlxGrid shows flexible and solid structure and can be presented in a variety of ways. Numerous skins are available; also complex, paginated table structures can be easily created. The scripts are released under the GPL; support costs money. Dhtmlxgrid
  3. Phatfusion Sortable sorts the columns in a table and filters its elements. Phatfusion Grid
  4. Mootable Sorting. Shows an example that highlights the table row and column of the cell you are hovering over. Mootable Grid
  5. Elite Zebra Tables – Zebra tables with sorting functionalities. Elite Zebra Tables
  6. 6. PHP Live Datagrid, based upon the XAJAX Library. Can be used for large databases, as shown in example containing over 500 pages. The table is paginated and can be browsed from page to page. XAJAX Grid
  7. Table Kit is based upon the Prototype Framework. The columns can be sorted, selected and the rows can be scaled. A tutorial related to table sorting ith Prototype is also provided. Table Kit Grid
  8. How to paginate, sort and search a table with Ajax and Rails. A comprehensive tutorial explains the basis of sortable tables with Ruby on Rails. Screenshot
  9. Unobtrusive Table Sort Script. Screenshot
  10. Yahoo UI Library’s DataTables. Various examples with various demos in a brief overview. The scripts aren’t necessarily visually appealing, however they deliver some functionalities one won’t find in similar scripts. The example shown below has sorting and editing functionality. Yahoo UI Grid
  11. Standardista Table Sorting Standardista Table Sorting
  12. Sortable Tables by WebFX. Webfx Grid
  13. SortedTable SortedTable
  14. Mootols Table Row & Column Highlighting. Shows an example that highlights the table row and column of the cell you are hovering over.Screenshot

The following scripts offer many features you may like to use in your application. Just give them a try and you may like them.

Courtesy : Smashingmagazine.com

I would love to see your comments here with your usability suggestions. If you like this post kindly subscribe to our RSS.

Popular AJAX & JavaScript programs for development

While programming an application Ajax should be used upto a level where it doesn’t confuse the users by offering too many controls to deal with. Ajax should be used in Interactive solutions for lightboxes, form validation, navigation, search, tooltips and tables are developed using Ajax libraries and nifty Ajax scripts. Following is the list of most popular AJAX & JavaScript programs which are used in many famous web applications. I suggest to read their manual carefully before using in your commercial project.

1. AJAX Instant Messenger
Ajax instant messenger is a browser-based instant messaging client. You can use it for chat application as It uses AJAX to create a near real-time IM environment that can be used in conjunction with community, intranet, and social websites. No refreshing of the page is ever needed for this “web application” to work, as everything is updated in real-time via JavaScript. Its FREE

AJAX Screenshot

2. Custom Checkbox with jQuery
This script provides you with the ability to customize the design of checkboxes in your web forms. You can use the default skin and the Safari skin which are provided with the package.
AJAX Screenshot

3. Oversized Sliding Tabs
Sliding Tabs is a mootools 1.11 plugin which adds a pretty neat effect. It’s a clone of something seen on Panic Software’s Coda site, which in turn is very heavily inspired by a widget used in the iTunes Music Store. Similar jQuery solution.
AJAX Screenshot

4. Mocha UI
Mocha is a web applications user interface library built on the Mootools javascript framework. The Mocha GUI components are made with <canvas> tag graphics.
Ajax Script

5. An Accessible Slider
Filamentgroup designed and developed an interface that required a slider control, which allows users to choose one or a range of values on a continuum. Values on a slider can represent anything from hours on a clock to the volume on a music player to a complex, proprietary data set. In its simplest form, the slider is displayed as an axis of values with a handle to drag and select a value, or two handles for selecting a range.
AJAX Screenshot

6. Coda Popup Bubbles
“When you move the mouse over the popup, this triggers a mouseout on the image used to trigger the popup being shown. I’ll explain (carefully) how to make sure the effect doesn’t fail in this situation.”
AJAX Screenshot

7. FancyUpload
FancyUpload is a file-input replacement which features an unobtrusive, multiple-file selection menu and queued upload with an animated progress bar. It is easy to setup, is server independent, completely styleable via CSS and XHTML and uses MooTools to work in all modern browsers
Modalbox

8. Rich Text Editor
The Rich Text Editor is a UI control that replaces a standard HTML textarea. It allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor’s Toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization. The tool is based upon Yahoo UI Library.

Texteditor

9. Facebook Style Input Box
The approach to re-create the autocomplete method of adding multiple recipients to messages used on Facebook. “I’d seen it in Facebook before, which has a really decent implementation of this concept (it work well, but it doesn’t respect any modern programming principles; basically, it’s a big tag soup with lots of inline Javascript)”

Screenshot

10. Ext JS – JavaScript Library
An extensive JavaScript-Framework with numerous modules and components such as tables, trees, windows, layouts, forms, and tabs. All of them look as if they’ve been used in standard desktop-applications. Extremely useful and widely used.

ext

11. iCarousel
iCarousel is an open source (free) javascript tool for creating carousel like widgets. iCarousel is compatible and tested in Internet Explorer, Firefox (and its mozilla friends), Opera and Safari, but it should work in other browsers too.

12. Product Slider
This ‘product slider’ is similar to a straight forward gallery, except that there is a slider to navigate the items, i.e. the bit the user controls to view the items.

AJAX Screenshot

13. Moo Wheel
The purpose of this script is to provide a unique and elegant way to visualize data using Javascript and the <canvas>-object. This type of visualization can be used to display connections between many different objects, be them people, places, things, or otherwise. The script is licensed under an MIT-style license. Great if you want to show how friends are connected in your social application.

AJAX Screenshot

14. Gettyone Search Options Menu
Learn how to implement a Gettyone-like search options menu which display a layer with some search options below the input search field, when an user click on the input field to searching for something.

AJAX Screenshot

15. Taggify Tooltips
This post demonstrates how you can use Taggify widget to enhance your blog with the functionality to show popup tooltips for parts of your images.

AJAX Screenshot

16. Relay – Ajax Directory Manager
Relay is an Ajax-powered file management library. It has a multi-user access restriction, allowing the administrator to control user access to uploaded files. Features: drag-n-drop files and folders, dynamic loading file structure, upload progress bar, thumbnail view, including pdf and multiple users & accounts.

AJAX Screenshot

17. Moo Canvas
Modern browser support the <canvas> tag to allow 2D command-based drawing. This script provides the third dimension, allowing for browser drawing with pure JavaScript. To use, web developers only need to include a single script tag in their existing web pages.

AJAX Screenshot

18. qGallery
qGallery is a Prototype-based gallery script which automatically takes care of the image processing, offers multipple viewing modes and comes with a number of transition effects. qGallery isfree for personal use

AJAX Screenshot

19. GlassBox
GlassBox is a compact Javascript User Interface (UI) library, which use Prototype and Script.aculo.us for some effects. With GlassBox you can build transparent border, colorful layouts and “Flash-like” effects. Take a look at the site itself: you can use the keyboard navigation: Keys 1-8 (display page), arrows left/right (previous/next page) and arrows up/down (Scroll content).

AJAX Screenshot

20. GWT-Ext Widget Library
GWT-Ext is a powerful widget library that provides rich widgets like Grid with sort, paging and filtering, Tree’s with Drag & Drop support, highly customizable ComboBoxes, Tab Panels, Menus & Toolbars, Dialogs, Forms and a lot more right out of the box with a powerful and easy to use API. It uses GWT and Ext.

Screenshot

21. Amberjack
Amberjack is a lightweight Open Source library, enabling you to create site tours. The JavaScript library is lightweight (~4K), stable, LGPL licensed, browser compatible, set up in 2 minutes & super-easy to customize.

AJAX Screenshot

22. Flexigrid
Lightweight but rich data grid with resizable columns and a scrolling data to match the headers, plus an ability to connect to an xml based data source using Ajax to load the content.

23. Masked Input Plugin
A masked input plugin for the jQuery javascript library. It allows a user to more easily enter fixed width input where you would like them to enter the data in a certain format (dates,phone numbers, etc). It has been tested on Internet Explorer 6/7, Firefox 1.5/2, Safari, and Opera.

AJAX Screenshot

24. cforms II
cforms is a plugin for WordPress, offering convenient deployment of multiple contact forms throughout your blog or even on the same page. The form submission utilizes AJAX, falls back, however, to a standard method in case AJAX/Javascript is not supported or disabled.

AJAX Screenshot

25. NicEdit
NicEdit is a Javascript/AJAX inline content editor to allow easy editing of web site content on the fly in the browser. It integrates into any site in seconds to make any element/div editable or convert standard textareas to rich text editing.

AJAX Screenshot

26. Mootools animated sidebar menu
This tutorial explains how to implement an animated menu using mootools. You can see how it works directly from mootools site.

AJAX Screenshot

27. Creating a table with dynamically highlighted columns
There is a number of impressive things happening within this small area.

AJAX Screenshot

28. LiveValidation
LiveValidation is a small open source javascript library built for giving users real-time validation information as they fill out forms. Not only that, but it serves as a sophisticated validation library for any validations you need to make elsewhere in your javascript, it is not just limited to form fields.

AJAX Screenshot

29. Unobtrusive Table Actions Script
An attempt at writing an unobtrusive (and fast) script that adds commonly required “actions” to data tables. Can Zebra stripe the table. And supports row hover, column hover and cell hover effects

AJAX Screenshot

30. Tablecloth
Tablecloth is lightweight, easy to use, unobtrusive way to add style and behaviour to your html table elements. By simply adding 2 lines of code to your html page you will have styled and active tables that your visitors will love 🙂 Try to mouseover or click on a table below.

AJAX Screenshot

31. Starbox
Starbox allows you to easily create all kinds of rating boxes using just one PNG image. The library is build on top of the Prototype javascript framework. For some extra effects you can add Scriptaculous as well. Check the demos below to see what Starbox is all about and read on for more information on how to customize your own Starboxes.

AJAX Screenshot

32. FancyForm
FancyForm is a powerful checkbox replacement script used to provide the ultimate flexibility in changing the appearance and function of HTML form elements. It’s easy to use and degrades gracefully on all older, non-supporting browsers.

AJAX Screenshot

33. The sliding Date-Picker
Due to the development of Qash.nl, a Dutch personal finance website full of cool javascript features, it’s somewhat quiet around here. But to keep you satisfied, we present the sliding date-picker. This element enables you to pick dates with a simple slider bar. By dragging the bar over the time-line, the dates change instantly.

AJAX Screenshot

34. Style Your Website’s Search Field with JS/CSS
Continuing to provide unobtrusive solutions, CSSG is happy to present SearchField. It serves as a way to style your search field and add behavior without any additional JavaScript or modifications in your markup. It features plug & play onfocus and onblur behaviors and auto suggestion like you’ve never seen before.

AJAX Screenshot

35. minishowcase
minishowcase is a small and simple php/javascript online photo gallery, powered by AJAX that allows you to easily show your images online, without complex databases or coding, allowing to have an up-and-running gallery in a few minutes.

AJAX Screenshot

36. Carousel
Prototype UI. Carousel are great to display a large set of data like images.

AJAX Screenshot

37. Displaying source code with Ajax
The script fires off an Ajax request, gets the document the link points to, replaces the special characters and adds line numbers.

AJAX Screenshot

38. Timeline
Timeline is a DHTML-based AJAXy widget for visualizing time-based events. It is like Google Maps for time-based information. Below is a live example that you can play with. Pan the timeline by dragging it horizontally.

AJAX Screenshot

39. mooSlideBox 3
The mooSlideBox v3 is a small and slim ajax based extension or replacement of the common “lightbox” that can be found on nearly every page. This lightbox clone works in IE 6/7, Opera and Firefox.

AJAX Screenshot

40. jsProgressBarHandler (Dynamic Unobtrusive Javascript Progress/Percentage Bar)
jsProgressBarHandler is a Javascript based Percentage Bar / Progress Bar, inspired upon JS-code by WebAppers and CSS-code by Bare Naked App. Next to a structural rewrite of the WebAppers code, this javascript progress bar can easily be extended and tweaked just by setting a few parameters.

AJAX Screenshot

41. mooSocialize – ajax based social bookmark widget
Enough of having to submit interesting articles by hand to your favorite social networks and newsgroups? Then this is for you. Based on ajax, this small widget allows to integrate many many bookmarks for every post on your blog, website etc.

AJAX Screenshot

42. CNN Style Scrolling Ticker with the Marquee Toolkit Control
Besides scrolling the items from right to left, the liScroll plugin supports two additional features

AJAX Screenshot

43. Cornerz
Bullet Proof Corners plugin for jQuery using Canvas/VML

AJAX Screenshot

44. CheckBoxList hover extender
“We created an AJAX Control Toolkit Extender that asynchronously calls a web service method (or a page method) to obtain the information displayed in the popup control, when the user hovers over an item.”

AJAX Screenshot

45. lightWindow
Another script you can use to integrate lightboxes and online-galleries in your web-pages. This lightweight script supports 5 different types of Media: Pages, Inline Content, Media (movies, SWF, etc), images (galleries, single), External Websites (via IFrame). Photo: Patrick Cheatham.

AJAX Screenshot

46. Lightview
Lightview was built to change the way you overlay content on a website. Works on all modern browsers

AJAX Screenshot

47. ModalBox
ModalBox is a JavaScript technique for creating modern modal dialogs or even wizards (sequences of dialogs) without using conventional pop-ups and page reloads.

Modalbox

48. DatePicker using Prototype and Scriptaculous
An unobtrusive and flexible date picker widget which uses Prototype and Scriptaculous libraries. 52 More Calendars and Date Picker Designs.

Date Picker

49. New unobtrusive dynamic flickr badge
A compact Flickr-Badge for presentation of Flickr-images with a navigation option.

Flickrbadge

50. 13 Awesome Javascript CSS Menus
13 “fresh” JavaScript+CSS-based navigation menus in a brief overview. Among other things Slashdot Menu and Sexy Sliding Menu displayed below.

CSS Menu

CSS Menu

You can see all the above used in one or other websites. They can help save your development time & cost. If you like this post kindly subscribe to our RSS. Please share how these scripts programs have helped you in your web application development. You may also be interested in our older post 20 MooTools Tutorials and Examples

6 Deadly AJAX Drawbacks: Are you aware?

AJAX combines the power of existing Web technologies to build powerful user interfaces that offer benefits often found in desktop applications. Over the past couple of years, Web developers have embraced AJAX in their own development efforts as well as via third-party toolkits.

Once you use an application built with AJAX, it’s easy to see the benefits: the user experience improves, as page reloads are reduced, and features such as automatic type-ahead facilitate data entry.

Some developers view AJAX as the silver bullet for every scenario. However, AJAX introduces its own set of hazards in various areas, which include: development time, browsing history and experience, search engine interaction, accessibility, server load, and security. Let’s take a closer look at each of these 6 areas.

1. Development time

It usually requires more development time to build an application using AJAX than using other approaches. Plus, learning a new technology like AJAX provides it own set of delays before properly understanding and using it.

Since it is a core feature, the amount of JavaScript contained with a page increases when an AJAX solution is tackled. Consequently, developers must be knowledgeable in JavaScript and related cross-browser quirks; as you probably already know, not every developer is especially fond of JavaScript. In addition, developers must be proficient in HTML and XML, as well as other technologies like CSS for style.

Another issue with JavaScript is that you have to consider what to do when a user has disabled JavaScript support within their browser. This requires extra development time to deliver an alternative solution (using the NOSCRIPT tag).

In addition, when developers jump on the AJAX bandwagon, you should make sure that they don’t use it for everything.

2. Browsing history and experience

The Really Simple History (RSH) JavaScript library highlights another major issue with Web applications that use AJAX: There is no browsing history, so Back/Forward buttons become useless. The lack of a browsing history emerges from the dynamic nature of an AJAX solution. Data is loaded asynchronously without a page reload, so no page access is recorded in the browser history. This means that users are unable to easily bookmark or navigate to and from the application using the browser’s buttons. RSH provides one way to build such functionality into an application, but it will add development time and testing.

3. Search engine interaction (Most Important)

Another issue emerging from the dynamic nature of AJAX is a lack of interaction with search engines. Search engines like Google require a page URL and use words on the page as one aspect of its approach to ranking pages.

Page data is dynamic within an AJAX application. Search engine spiders do not load a page and execute its JavaScript. This results in search engines ignoring an application or a page. This can lead to lost visitors, but it will not be an issue for internal intranet applications.

4. Accessibility

AJAX is not the most accessibility-friendly development paradigm. AJAX makes the browser act in a way that is different than its original design; for instance, Back and Forward buttons no longer work as expected, and there is no URL for some AJAX content.

These issues should remain in the forefront as you develop an application (regardless of whether it uses AJAX). You can apply the techniques I discussed in the section about browsing issues.

AJAX is not supported in browsers on mobile phones and PDAs, so these devices can be used as a reference point for developing applications that are accessible to everyone. O’Reilly’s Ajax: The Definitive Guide does an excellent job of stressing accessibility while using AJAX.

5. Server load

Server load and bandwidth can be an issue when delivering AJAX-based solutions. These solutions often use AJAX to provide features like type-ahead searching in text boxes or loading data in the background. The user may see fewer page reloads, but the server calls are still there.

It is worth considering whether the backend server can handle countless simultaneous calls to the server when many users are using the type-ahead feature. An overworked server can lead to an interrupted user experience with lags in loading data asynchronously. Displaying interim messages like “Loading” can alleviate user concerns because this lets them know something is happening rather than being presented with a blank page.

6. Security

Security has always been an important issue with Web applications, and AJAX is no different. Like any other application that uses the HTTP protocol, data is sent as clear text. For this reason, no sensitive data should take a ride via HTTP using AJAX or any other technology.

While JavaScript is a mature language, it does have security holes that must be recognized regardless of whether you’re using AJAX. Server-based security measures can be used to block such problems. Also, the issue of cross-site scripting — XSS is more pronounced with AJAX, as script may run in the background and access resources without user knowledge. Given these possibilities, all data must be protected to avoid malicious activity.

Make a well-informed decision

There are times when AJAX is applicable, and there are times when you should choose another approach. Be sure to consider potential issues with AJAX before putting it to use in your next application. A hybrid approach is usually the best solution with AJAX because it provides certain features in the user interface and other technologies used in other facets of an application.

20 MooTools Tutorials and Examples

There are literally over a hundred of JavaScript frameworks out there that make writing complex client-side code significantly easier. If you’re in the market for a powerful, relatively lightweight, and customizable JavaScript framework, MooTools is worth checking out.

To help you get on your way to developing highly-interactive web applications using MooTools, here’s 20 tutorials and working examples that’s worth a read.

Getting Started with MooTools

1. The “Mootorial”

The Mootorial - Screenshot

The Mootorial at //clientside is a comprehensive, practical tutorial on the MooTools framework. The tutorial allows you to execute the sample code either by Firebug or the website’s built-in console.

2. MooTools Overview Video Tutorial

Here’s an excellent screencast that introduces the MooTools framework. It covers the basics such as the concept of chaining, customizing MooTools to your needs, and where to find documentation for MooTools code.

3. Increasing User Experience With Javascript

Increasing User Experience With Javascript - Screenshot

Beauty By Design provides a nine-part video series on improving user interaction using JavaScript (primarily MooTools). A couple of topics covered in the lessons include: using mooTabs, creating sliding sub menus, and using Fx.styles to control font size.

4. Understanding Mootools Selectors

One of the most powerful features of MooTools (as well as other frameworks/libraries like jQuery and Prototype) is the ability to easily select page objects for you to work on. This tutorial covers the basics of selectors in MooTools: $(), $$(), $E(), and $ES() functions.

5. MooTools MooTools Classes: How to use them

This tutorial is an entry-level introduction on working with classes in MooTools. The tutorial works with a hypothetical scenario (buying a car from a car store) to illustrate the concept of classes. The last section of the article discusses the differences of MooTools and script.aculo.us classes.

Intermediate/Advanced Topics

6. Mootools: Ajax and XHR classes

MooTools’ Ajax/XHR classes provides developers a much simpler way of working with XMLHTTPRequests by reducing the amount of code you have to write and by handling browser differences for you. This tutorial talks about the Ajax and XHR classes in brief.

7. Ajax Responder in MooTools

This article delves into the use, extension, and capabilities of the Ajax class in MooTools. It discusses chaining Ajax requests and events, and how you can extend the Ajax class for your needs (also applicable to other MooTools classes).

8. How well do you know Mootools?

Getting started with MooTools is easy, and it won’t be long until you can create wonderful effects and increase user interactivity in your web pages. To help you become a MooTools master, here’s a checklist of common coding mistakes and its corresponding correct usage.

9. Mootools Short-cuts

This is a follow-up article from the one above, focusing more on MooTools syntax usage. Examples involve using shorter code for selection of objects, shorthand for the Ajax class, and creating new elements.

10. Mootools: JSON explained

Mootools: JSON explained - Screenshot

Here’s an excellent introduction to using JSON with MooTools to provide server-side interaction to your web applications. Topics covered include converting a JSON string into a JavaScript object and vice versa.

11. Using MooTools’ Hash.Cookie API

This article explains how to take advantage of MooTools’ powerful Hash.Cookie API to make working with complex cookie utilization a cinch. The example showcases a working example of how you can store the number of times a user visits a page.

12. Chaining with MooTools 1.2

Chaining is beneficial for several reasons including the ability to sequentially execute events (“in a chain”) as well as reduce the number of lines of code you have to write. If you’re wondering about the “who, what, where” of chaining in MooTools, check out this brief but informative tutorial.

Practical/Working Tutorials and Examples

13. AJAX mootools secure contact form

AJAX mootools secure contact form - Screenshot

Learn how to protect your public web forms from spam and SQL injections with this tutorial on how MooTools can be used to make safer public web forms.

14. Using CSS and Mootools to simulate Flash horizontal navigation effect

Using CSS and Mootools to simulate Flash horizontal navigation effect - Screenshot

Create a navigation area that smoothly scrolls left or right depending on where you hover your mouse.

15. Facebook Sliders With Mootools and CSS

Facebook Sliders With Mootools and CSS - Screenshot

Check out this nifty tutorial on how to build a Facebook-inspired set of slider controls that manipulate the opacity, width, and height of an image.

16. MooTools Gone Wild: Element Flashing

MooTools Gone Wild: Element Flashing - Screenshot

In this tutorial, you’ll learn how to make page elements flash. It’s an effective way of drawing attention to a particular section of a web page or alerting users of status changes.

17. Nice Ajax effect for message box using Mootools

Here’s a tutorial on how to display messages that fades in after the user clicks on the submit button. It’s designed for use with web forms, but it can be modified into similar applications.

18. Two CSS vertical menu with show/hide effects

Two CSS vertical menu with show/hide effects - Screenshot

This tutorial shows you how to build a navigation menu that slides up and down smoothly using MooTools. The article also covers how to make a similar effect using plain JavaScript.

19. Mootools Content Slider With Intervals

Mootools Content Slider With Intervals - Screenshot

Here’s an excellent step-by-step tutorial on how to make a content area that slides left-to-right at set intervals – great for slideshows.

20. Jazz Up Your Forms With MooTools

Jazz Up Your Forms With MooTools - Screenshot

This is a two-part series that goes over how to make your web forms fancier. The first part shows you how to add animated field highlighting and how to display instructions to users. In the second part, you’ll step it up a notch by adding live comment previewing and auto-resizing of text areas.

Additional Tools

  • Vista like JavaScript/PHP DatePicker : The Vista-like Ajax Calendar (vlaCalendar) version 2 is a unobtrusive  web version of the slick and profound Windows Vista taskbar calendar, by using the MooTools javascript framework, AJAX, XHTML, CSS and PHP.vlaCalendarExamples.jpg
    Key features:
  • Authentic Vista look-and-feel
    • Quick navigation by jumping back and forth between months, years and decades without drop-down boxes
    • Smooth transition animations
  • Customizable features
  • Lightweight
  • Datepicker functionality (!)
  • Cleaner and more developer centered – easily editable – CSS, PHP and javascript code
    • Easily changeable date labels (e.g. different languages)
    • Easily stylable. Styles are created on top of the general style; the download include two example styles
    • Both normal and datepicker calendar can be instantiated multiple times

Please post your experiences with the above tools. If you like this post kindly subscribe to our RSS for free updates and articles delivered to you.

10 things AJAX developers MUST know

1) Ajax is an idea, not an acronym

While Ajax commonly is spelled out as Asynchronous JavaScript and XML, the full name is not entirely appropriate because it oversimplifies the history of the technology and the implementation options that lie at its heart. More exactly, Ajax encompasses the idea that Web applications can be built to opt out of the typical post-wait-repeat cycle used in server-side-focused Web applications. Ajax lets Web applications move to a more responsive, continuous, but incremental style of updating. Ajax provides users a richer, more interactive way of experiencing the underlying Web application. This goodness for the user might mean that more monitoring and security oversight might be required of network professionals, as well as, potentially, server and network alterations.

2) It’s really all about JavaScript

Ajax applications are written in JavaScript and usually rely on the XMLHttpRequest object for communications, which is making its way through the World Wide Web Consortium process. Because, like many Web technologies, it now is only an ad hoc industry standard, notable differences can be found in various browsers’ implementations of it. It’s also possible to use other data transport mechanisms — with and without widespread industry support — with Ajax applications, including traditional frame and image-cookie methods, as well as the use of binary bridges to Flash or Java.

Regardless of the transport approach used by the developer, Ajax has raised JavaScript to a more important position within a Web application than it previously held. JavaScript now is responsible for important data-collection, communication and consumption duties, so it no longer can be treated as a second-class Web technology without serious repercussions.

Developers who think the JavaScript technology is toxic can try to avoid the language by having a tool or framework generate it from some other language like Java (Google Web Toolkit, for example), or hide the code behind components or tags (such as with .Net or Ruby). At the end of the day, however, JavaScript still will be in the application. It’s better to understand the language and embrace it directly, because if you are going to use Ajax, you ultimately are using lots of JavaScript.

Ajax is intertwined with the network, so bad code is going to mean lots of troubleshooting by network administrators, as well as developers: The bottom line is to encourage good, network-aware coding! The same organizational "rules and tools" — coding standards, testing regimes and source-code control — that are in place for other languages must be applied to JavaScript to ensure that Ajax applications are supportable and robust.

3) XML is not required

Despite the "x" in the acronym, Ajax does not require XML. The XMLHttpRequest object can transport any arbitrary text format. For many Ajax developers, JavaScript Object Notation or even raw JavaScript code fragments make more sense as a data format, given that JavaScript is the consuming environment. For direct input into documents, other developers may favor raw text or HTML fragments. Still others will use such data formats as the less-known YAML markup language or such old standbys as comma-separated values.

Of course, it is possible and certainly reasonable to use XML, but it is far from required. Using binary formats for uploading files is not supported yet by the XMLHttpRequest object, but considering that Flash uses a binary format called Action Message Format, it is likely that similar features will be found in Ajax applications soon enough. You should know which format is being passed around the network, because it isn’t always XML. Also, make sure you can analyze the format for performance and security.

4) Plan for an increase in HTTP requests

The most obvious issue for the network administrator supporting Ajax applications is that the architectural programming pattern has changed the network utilization of Web applications from a batch-like, somewhat infrequent response of a few hundred kilobytes, to a more continuous exchange of smaller HTTP responses. This means that network-bound Web and application servers may find themselves even busier than before. What Ajax will do to your server and network utilization certainly will depend on how the application is built — make sure your developers understand the network impact of their applications.

5) Optimize Ajax requests carefully

Web applications should adhere to the network delivery principle of sending less data, less often. That doesn’t mean that this principle is widely followed by developers, however. Fortunately for the network, HTTP compression of Ajax responses can reduce response size and is supported in all modern browsers. Because of dynamic compression’s overhead, however, speed may not improve much if responses are indeed relatively small. This means that it would be wise for network administrators to turn on compression on their Web server, but they need to understand that with Ajax applications, their gains won’t be as big as with traditional Web applications.

To send data less often, we generally would employ caching. Most Ajax implementations can be openly hostile to caching, however, given certain assumptions made by browsers regarding not re-fetching URLs during the same session. Rather than work with caching, many Ajax developers will work aggressively to defeat caching via the header setting or URL uniqueness.

It is possible to address caching concerns with a client-side Ajax cache written in JavaScript, but most Ajax libraries do not implement such a feature. Network professionals should show developers the benefit of caching, because Ajax probably will benefit more from that than from compression.

6) Acknowledge the two-connection limit

Ajax applications are limited by HTTP to two simultaneous connections to the same URL. This is the way the HTTP protocol is designed, not some browser bug or limitation. The good news is that it keeps many Ajax developers from swamping a server accidentally, though Microsoft’s Internet Explorer 8 is supposed to go well beyond the limit. Chatty Ajax applications can be trouble, and with browsers changing the rules, network administrators need to keep a close eye on the number of requests made, and work with application developers to avoid employing such design patterns as fast polling or long-held connections.

7) Watch out for response ordering

With traditional Web applications, the network effects of TCP/IP communications — such as the lack of order in which individual HTTP responses are received — generally are not noticed by developers or users. The base unit, the HTML document, is received before other objects, and it then triggers the request. Any subsequent request triggers a whole new base document, thereby guaranteeing order. Ajax takes such implicit ordering away, however, so that an application dependent on proper sequencing requires a response queue. Ajax frameworks, however, are not consistent in acknowledging this network concern. So, again, make sure Ajax application developers understand such network-level concerns.

8 ) Acknowledge the effects of eliminating "Layer 8" error correction

For years, users have been correcting Web-delivery quality by reloading pages or pressing the Back button. Simply put, users doing this help mitigate network problems because errors occur generally at expected moments between page paints. With Ajax, however, application failure is no longer that obvious. Worse yet, users often are misinformed about errors, because the simple, animated-GIF spinning circle provides little information about the true status of the request.

Developers are at a loss because many libraries aren’t effective at acknowledging that timeouts happen, retries must occur, and server and data errors crop up. JavaScript diagnostics showing communication and code errors are rarely in place on the client side, so blissful ignorance is the norm. More application-level monitoring is required for administrators to support Ajax properly.

9) Old security threats get a second exposure

If you listen to the pundits, Ajax may appear to produce more attack surface, but it really isn’t any less secure than traditional Web-application development environments, because the HTTP inputs to the trusted server side are the same — headers, query string and message body. If implicitly trusting client-side code and entered data is not verboten already in your Web development group, however, Ajax may push things in that direction.

Cross-site scripting (XSS) isn’t a vulnerability new with Ajax; it is just more common, especially if an application allows state data to be manipulated with JavaScript. HTML input should be disallowed in most cases, and HTTP Only Cookies should be applied immediately to reduce cookie hijacking and other attacks via XSS.

Cross Site Request Forgery likewise isn’t new with Ajax, but if your application developers aren’t checking the HTTP Referer (sic) header and managing sessions properly within Ajax applications, you’ve already been open to it, although it might be worse now.

Hackers, like developers, now are more interested in using and abusing JavaScript, which increases the potential for exploits. Network professionals should make sure developers are aware that client-side code can be manipulated even with obfuscation in place, so data inputs should always be filtered and sanitized, Ajax or not.

10) Abide by same origin for your protection

On the positive side of security, JavaScript’s same-origin policy (SOP) is fully enforced in an XMLHttpRequest-based Ajax application. This policy makes sure that scripts cannot talk to domains outside of those from which they are issued. From the developer’s point of view, this can be quite annoying because it means that pages served, for example, from ajaxref.com can’t talk to a URL hosted on www.ajaxref.com; even if it is the same machine, it isn’t the same exact domain. DNS equivalency doesn’t matter here; it is a string-check employed by the SOP.

The SOP will severely hamper a developer’s ability to perform some Web-service efforts on the client side as well. Clearly the best approach is to use a proxy on the server to bounce requests to other servers and combine the results. However, many Ajax developers attempt to break the same-origin restrictions. Using the <script> tag as a transport instead of the XMLHttpRequest object introduces dangerous trust assumptions, and that leads to the origin of much of the concern about overall Ajax security.

Now, with such browsers emerging as Firefox 3 and Internet Explorer 8 employing native cross-domain request facilities, there is certain to be more trouble on the horizon. As is the case with Java’s security-sandbox concept, SOP restrictions are introduced just to keep developers from destroying security. Go around such safeguards with extreme caution.

Watch what you wish for

With Ajax, rich-application widgets will win a project, but bad plumbing may sink it. If the promise of a rich Ajax application is delivered in a network environment that is occasionally fragile, users will become disillusioned with the perceived instability of the application regardless of its slick interface. To enable desktop-like quality, network professionals must educate Ajax developers about certain network and security fundamentals and provide a solid and constantly monitored delivery platform that includes client-side diagnostics on JavaScript functioning and network performance from the user perspective. Users regularly see rich Web applications done right — like those coming from Google, for example — so anything less is a risky endeavor.