Tuesday, February 27, 2007

how many JS Ajax frameworks ?

My guess is that Domino developers are interested in Ajax frameworks for JavaScript. While there are other server-based frameworks, guess how many Ajax JS frameworks you have to choose from (some open-source, as my newly beloved jQuery, others commercial). So, take a rough guess: 5 ? 10 ? Ntz. A wiki like site gives the answer: 36. You can see this on http://ajaxpatterns.org/Javascript_Multipurpose_Frameworks

This is something I was astonished about, then I came to think this is normal. JavaScript is blamed for it's lack of debugging but it's so versatile that I could also start my own framework. I'm not so clever though; then why bother if others took the lead and gave the world jQuery ?

when Domino meets jQuery ...

The result is what I wanted: to have a minimum of files (read one file) which needs to be included into an existing application (read nsf database).

Past one-two years there have been a rise in the Ajax acronym used together with the Domino environment. While IBM seems to have bet on Dojo and I personally liked and used YUI, I also thought what could be the best way to include a framework like these into Domino applications.

Generally speaking, having JS resources available in one place in a Domino app can be accomplished in at least 4 ways, depending on how you organize your app.

When we want to integrate Dojo or YUI, I can count for only three methods:
1. put the folder structure of the Ajax framework into the domino\html folder on your server.
2. archive the Ajax framework into a zip file. On deployment, run some agent on the server which accomplish the result at 1.
3. have WebDav enabled on the Domino server and copy the folder structure of the chosen Ajax framework as file-resources in some template or database. Then, you simply copy those file-resources around, where you need them.

All above methods require more or less effort, but they didn't address my need: to handle Ajax calls and goodies without using them :) When we start a new application, choosing between Dojo or YUI is a process which can find its answer, then we'd need to know what above method to choose in order to handle the chosen framework.

I needed something simpler: to have a light JS library which can handle Ajax calls so that I will further standardize the work I'm performing to the existing set of templates. No more 'xmlHttp = new XMLHttpRequest()' for me.

Meet jQuery. Import your jquery-latest.pack.js as only one file-resource. Then import the location of the file as 'script src' and have fun with $.ajax

Light, simple, brilliant. It does not have all the other goodies of the Dojo or YUI. But it will have the goodies of the yui-ext soon. Check their vision. Add it to your existing Domino apps.

update: seems to me that when I discovered for myself the jQuery library, our fellow Domino blogger Jake is also playing with the ext library. His work is much more appreciated than my thoughts, though :)

Disclaimer: The information in this weblog is provided "AS IS" with no warranties whatsoever, and confers no rights to any institution/person/organization. These are my personal thoughts and ideas. When I am inspired by others I give credit, I do not assume other's work and efforts. This site is NOT supported, approved, blessed etc. by Lotus Software and/or IBM Corporation.

Creative Commons License

This work is licensed under a Creative Commons Attribution 3.0 License.