Tuesday, November 15, 2005

OpenRico AJAX Library

OpenRico is an open-source Javascript library that allows you to create rich Internet applications with AJAX functionality. OpenRico AJAX library provides complete AJAX support with drag and drop functionality. In addition OpenRick AJAX supports cinematic effects using AJAX.

According to OpenRico website,
Rico originated as work done in Sabre Airline Solutions to create a suite of rich internet components, behaviors and effects for the web application space

The library is a fully object-oriented and extends on the excellent prototype.js effort from the Ruby on Rails folks.


Very soon I will be posting an on how to create a reader using . In my development, I have been able to get it working for RSS files but files and certain RSS files are still giving issues. Stay tuned for more on AJAX RSS reader.
  post to Del.icio.us

Sunday, November 13, 2005

AJAX Tutorial

While I would like to call this tutorial, "", you may call it "Yet another AJAX tutorial" or whatever you like :).

AJAX BASICS
AJAX is short for Asynchronous JavaScript and XML. Though the name is new, the technology isn't. The main reasons for using AJAX are
1. Remote Procedure Calls (making posts to the web server without having to reload the page)
2. Javascript parsing capabilities for XML documents.

Before we can make a HTTP request, we will need to create an instance of XMLHTTPRequest class for Safari and Mozilla based browsers (Firefox, Netscape etc). For Microsoft Internet Explorer (MSIE) compatibility, we need to create an instance of Microsoft.XMLHTTP. The reason is because in MSIE, XMLHTTP functionality was implemented as an ActiveX object.

Static function:
Dynamic function
http_request.onreadystatechange = function(){
// code here
};


Creating a request (can use GET, HEAD and POST):

http_request.open('GET', 'http://www.ajax-xml.blogspot.com/atom.xml', true);
http_request.send(null);

3rd party URLs cannot be opened due to browser security features. Toggle the asynchronous mode using the third parameter. As documented on Mozilla.org,

If TRUE, the execution of the JavaScript function will continue while the response of the server has not yet arrived. This is the A in AJAX.




1. Create an instance for XMLHTTP request
2. Override the header returned from the server (to ensure mime-type header is set to always xml). This can be accomplished by calling the member function overrideMimeType for our instance of XMLHTTP object with parameters set to "text/xml".
3. Take care of the response returned by server.
4. Set the onreadystatechange property of HTTP object to the name of function that will be invoked when the server returns a response.
5. To use POST, we must use
http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

6. To use GET, we must append "escaped" variables to the URL.
7. HTTP server response: http_request.status == 200
8.

States of readyState (http_request.readyState == 4):
# 0 (uninitialized)
# 1 (loading)
# 2 (loaded)
# 3 (interactive)
# 4 (complete) - means full server response has been received and it's OK for us to continue processing.

To be continued....



The following sources were consulted, referenced and used in this AJAX tutorial.
  post to Del.icio.us

Dojo AJAX Library

With AJAX creating the buzz these days, AJAX libraries, AJAX toolkits and AJAX tutorials are popping up everywhere. According to the main website of Dojo AJAX:
Dojo is an Open Source toolkit that allows you to easily build dynamic capabilities into web pages and any other environment that supports JavaScript. Dojo provides components that let you make your sites more useable, responsive, and functional. With Dojo you can build degradeable user interfaces more easily, prototype interactive widgets quickly, animate transitions, and build AJAX-based requests simply. Dojo layers these capabilities onto a lightweight packaging system which forms the core of Dojo. When you write scripts with Dojo, you can include as few or as many of the available APIs as you need, and your app will only include what it uses.


Since Dojo AJAX toolkit has the backing up of open source, I think it will make it big and convert into a stable project. Declaring and using responsive DHTML interface components with this AJAX library is a snap. According to Dojo's site:

Dojo also provides application authors with a simple way of declaring and using responsive DHTML interface components. Prototype to deployment, Dojo is markup all the way, allowing you to work faster without having to learn new tools or APIs for things you already know how to do. Better yet, Dojo lets your widgets be portable between HTML, SVG, and whatever else comes down the pike. When your application is built on Dojo, you don't have to choose a technology before you choose what's best for your users.


Check the Dojo site for latest version of Dojo AJAX. For convenience, you can download the current version of AJAX library by Dojo. Stay tuned for more AJAX tutorials and information on Dojo AJAX.

Tags:
  post to Del.icio.us

Saturday, November 12, 2005

AJAX , SOAP and Web 2.0

James Snell, a software engineer at IBM, has a great article on building SOAP (Simple Object Access Protocol) client with AJAX. James writes:
In order to invoke Web services from within a Web browser and reliably process the SOAP messages, you need to first understand the security issues. (See the sidebar "A Word about Security.") You also need to write a JavaScript script library (Figure 2) that can abstract away the inconsistencies of the underlying browser XML implementations, allowing you to work directly with the Web services data.


An example of AJAX based RSS reader is available here. More AJAX examples from DrClue.

On February 18, 2005, Jesse James Garrett, coined the term AJAX in the following passage. Believe it or not, since then AJAX has been the "buzz word."


Google Suggest and Google Maps are two examples of a new approach to web applications that we at Adaptive Path have been calling Ajax. The name is shorthand for Asynchronous JavaScript + XML, and it represents a fundamental shift in what’s possible on the Web.


Fueled Software has a few pointers on how not to use AJAX. Meanwhile, Informit has an article on how to use AJAX.

From the "Good Ajax Gone Bad" section of AJAX article by Fueled Software,

While Ajax is a compelling idea, too many people are jumping on the Ajax bandwagon and using it in ways that are overboard. In this post, we are going to look at some of the times when Ajax goes bad. Before we do, I want to say that these are merely examples of inappropriate or unnecessary use but they demonstrate concepts that can be useful.


According to the AJAX tutorial by Informit,

Kris Hadlock explains how to use AJAX in a real-world situation and how you can assess its value in a project. By the time you finish reading this article, you'll know what AJAX is as well as where, why, and how to use it.


The core features of Web 2.0 and section on AJAX from a Powerpoint tutorial by Anubhav Kale on AJAX


Core features of Web 2.0
Web as a Platform
Collective Intelligence
Above the level of Single Device
Services , not packaged software
Rich User experiences

AJAX
Assists in User Interfaces
Less machine readable / linkable webpages


  post to Del.icio.us

Thursday, November 10, 2005

AJAX

Popularity of AJAX is increasing day by day. Google, Yahoo!, and Microsoft have all launched applications with AJAX. With this blog, I will help you understand and track AJAX developments.

AJAX is an abbreviation for Asynchronous JavaScript and XML

How to Learn AJAX in 20 minutes.
Tutorial: AJAX and PHP.
AJAX and XMLHttpRequest for PHP programmers

Tags: AJAX XML
  post to Del.icio.us

eXTReMe Tracker