Introduction to AJAX
Posted by Anandhan Subbiah on Apr 30, 2007 in Programming Concepts, Technical Articles • No comments
servicesThe diagram sums up what Ajax does. Content1 and content2 are treated as separate entities. The user will be able to update content2 without modifying the state of content1 and vice versa. The aggregation of data is another key feature to be noted
The Ajax approach is fairly new—there really aren’t any established best practices or heuristics. However, standard Web design principles still apply. As time passes and more people experiment with this approach, we will find the limits and establish guidelines. The best approach to any web site design is to listen to the users. A cutting edge website is useful only if there regular visitors.
When should you AJAX?
Don’t waste time inventing new user interaction models that your users will be unfamiliar with. Borrow heavily from traditional web applications and desktop applications so there is a minimal learning curve With Ajax, the line between thick and thin is blurred, and the real winners are your users! It is important that the users of your website really accept any changes you make the site so remember, when in doubt, test with representative users!
Technical / Architectural challenges
Ajax is a client side technology just like Flash so it makes lot of sense to think twice before writing a single line of code. Poorly coded scripts can quickly spiral out of control, especially as volume increases. Put simply, don’t surprise your users. If your pre-Ajax application didn’t save the form when they tabbed off the last field, your post-Ajax application probably shouldn’t either
The data being transmitted between server and client should be minimal. The data structure hence has to be precise and should be as small as possible.
| Feature | Flash | Ajax |
| Browser Integration | Flash Player plug-in required. Flash is limited to a predefined rectangular area of the browser. | JavaScript natively supported by modern browsers. Simple interaction with any part of the browser. |
| Compatibility Issues | Minor variations between versions of Flash. | Major compatibility differences between browser versions. |
| CSS | Limited support. | Full Support (depending on browser). |
| Dynamic Content Generation | Difficult. SWF is a pre-compiled closed format. Currently there is no language to describe SWFs. (Compare SVG, which is XML-based.) | HTML can be written out using just about any kind of Server technology. Dynamic image generation is more difficult, but is possible on some platforms (like PHP). |
| Programming Model | ActionScript 2.0 provides robust, java-like framework. | JavaScript 2.0 not yet supported by any major browser. JS 1.5 not recommended for large OOP applications. |
| Raster (Bitmap) Graphics | Load static images dynamically. Support for JPG, GIF and PNG. Bitmap manipulation. | Load static images dynamically. |
| Regular Expressions | Not supported natively by AS 2.0, but open-source solutions are available. | Full support. |
| Server Integration | Many solutions available. Flash can communicate with ASP, PHP, ASPX and many other types of server scripts. Commercial solutions, like Flash Remoting, are also available that provide live connections to a database. | Limited. Can communicate dynamically with server using IFRAME trick or XMLHttpRequest Object. |
| Text | Text API mimics some HTML functionality. | Powerful layout capabilities. |
| Vector Graphics | Full Support. | None. |
| Video | Dynamically load FLV video files or playback embedded videos. | Supported only through external plug-ins (like Media Player). Multiple Video Formats can be loaded. |
| XML | Full support. | Not supported natively by JavaScript. |
It is obvious that Flash natively supports streaming audio and video; it can integrate audio and video content directly into its plug-in. It also has far more robust sets of out-of the-box user interface components than Ajax does (after all, Ajax is still working off the HTML Document Object Model).
Flash costs $700 for developers to get their hands on. Ajax requires only persistence, and notepad
Ajax just augments HTML so is more web spider friendly than Flash.DHTML pages will be much easier to download but then again it depends on the design of the page. The market trends clearly suggest that It is much easier to find HTML /JS developers than Flash developers. Ultimately the two technologies have very different profiles, and in many ways compliment each other, so both are likely to be quite important to web developers for the conceivable future.
