Javascript

Insanely easy tabbed web pages with Prototype

I came across this today when trying to find an easier way to present a six-part form in a Rails project - a tabbed interface system built upon Prototype (an integral part of Rails). Called Control.Tabs it makes tabbed interfaces a synch to do: simply add an unordered list containing links to the blocks containing your to-be-tabbed content, and add a line of JavaScript to start the ball rolling - that's it!

Tags: 

Scriptaculous + JS optimizations can cause problems

With everyone raving about YSlow I used it to prune a new project I was doing. Well, after the results worked just great with Safari and Firefox I was thoroughly confused why it wasn't working correctly in IE. The problem was that my Script.aculo.us routines weren't working, and more specifically I was getting really weird errors when the page was loading, before any of the routines executed. Some of the errors were very vague, e.g. "'Class' is undefined", and "Effect.toggle is undefined".

Tags: 

Awesome form validation script

I use the Javascript libraries Prototype and Script.aculo.us a good deal in my projects, but there was one feature they didn't have between them - form validation. A quick google uncovered a super-simple solution to this problem written by an Australian - all you need to start is one Javascript file and one line of Javascript, then add one single DOM-compatible attribute to your input lines and it'll work right out of the box. The even better part is that extending and enhancing it is very easy, just add a CSS line or two to customize your error messages, etc, easy as pie.

Tags: 

Catfish fun with script.aculo.us

Script.aculo.us is a wonderful library of Javascript functions for doing lots of buzzword-friendly snazzy effects. A recent schmancy JS trick is the catfish - a small, unintrusive advertisement that pops up at the bottom of the web page and can be closed without affecting the web page. Looking around I didn't see any existing code to do catfish effects with Script.aculo.us so I decided I'd have to fill the gap.

Tags: 

Pages

Subscribe to Javascript