About a year ago one of my co-workers introduced me to the Scriptaculous Javascript library. At the time I have to admit I wasn’t very impressed by Javascript-anything, but I was working on a project which was going to require a moderate amount of javascript and I decided to give it a try. I’ve been hooked ever since. The thing I like about it is that like any good framework, you write a lot less code but gain a great deal of reliability and functionality. And at about the time you start to appreciate how much less code you’re writing you figure out that with just one or two more lines you can make it look cool too.
Scriptaculous is built on Prototype which is an independent Javascript framework used by several libraries in addition to Scriptaculous. Prototype’s claim to fame is the $() function, which is used to reference html elements and is far easier to type than document.getElementById(). The framework is chock full of functionality to make your life easier and also provides an abstraction layer to the browser so Prototype handles any compatibility issues for you.
Here’s a couple of my favorite Prototype functions:
//returns all elements which have a specified css class
document.getElementsByClassName([class name]);
//attaches a function to an object event
Event.observe([object],[event name],[function]);
//converts the input fields of a form in to an Ajax compatible query string format
[Form Object].serialize();
The Scriptaculous library then has an additional set of utilities, controls and my favorite the effects.
Couple of my favorite Scriptaculous Functions:
Effect.Fade($("testdiv"))
Effect.Appear($("testdiv"))
Effect.BlindDown($("testdiv"))
All of this brings me to Stellent/Oracle who actually have a Javascript preference of their own, the Yahoo YUI library. I am also a big fan of YUI, but it’s much more of a control library then a framework. This has caused problems for me when working with 3rd party web designers who are not developing HTML specifically for YUI. Scriptaculous on the other hand often works great regardless of how the HTML is designed. Both libraries can live harmoniously on the same page and I’ve often found myself using the Prototype $() function to reference YUI controls.
Oracle/Stellent implements the YUI library using a component which places their Javascriptand CSS files in the weblayout/resources folder. Using that same concept, I put together a quick and dirty Scriptaculous component which does the same. In addition there’s a resource override of the std_html_head_declarations include, where I’ve added a reference to the library, making it globally available in the Content Server UI. That component is available for download here and it includes the latest release version of Scriptaculous 1.7.0.
Updated: 11/10/2007 – The latest Oracle / Stellent Script.aculo.us component(version 1.8) may be downloaded here:
Script.aculo.us Component for Oracle / Stellent Content Server
Script.aculo.us is great, but I am in love with JQuery. Right now it’s still my JavaScript Library of choice.
YUI stuff is excellent, there is YUI .NET which we use for some projects.
Ok, now I’m going through and looking over some of your other posts. You seem to have some in depth knowledge of CMS. We primarily do DNN, Joomla & Drupal. Plus a hand full of e-commerce systems depending on the exact needs.
I’m a MS SQL & MySQL buff, know nothing of Oracle so some of these should be good reads.
Ryan
DotNetNuke Consultant