Category Archives: Javascript

October 28, 2009
Extracting URL variables using JavaScript

Server side languages are cool in that they give you a nice associative array to access URL variables. ColdFusion has the URL scope, PHP has $_GET[] etc, but how do you get these values easily with JavaScript?
I came across a post over at Jake Munson’s blog which had just what I needed. Actually although Jakes [...]

June 15, 2009
Prototype/scriptaculous issue with Sortable.create()

I’ve been doing some custom sorting within FarCry using the prototype/scriptaculous libraries as they already exist in the FarCry framework by default.
I was having trouble getting the Sortable.create() to work properly and the main docs site for scriptaculous seems severely lacking in examples. Basically the “sorting” action was happening fine but no event was being [...]

March 11, 2008
Passing extra parameters to Prototype observer handlers

Another tip from my Prototype travels…
‘Observers’ let you create a listener for a user event, for example on a form submission you may want to run some client side validation before actually submitting the form.
Of course you can add ‘onsubmit()’ in your <form> tag, but isn’t it much nicer to keep your markup clean of [...]

March 10, 2008
Showing and hiding elements with CSS and JavaScript

* Note: These examples reference the Prototype JavaScript framework.
Often I find that I want to load content onto a page but have its default view state as hidden until a user defined event makes it appear.
The problem is if I hide an element using a linked CSS file (with a class or Id style of [...]

January 23, 2008
Taking advantage of DOM on ready and Event observers using Prototype.js

I’ve been doing some JavaScript development with Prototype over the last few days and it’s been interesting trying to do things that I know how to do in jQuery, but in Prototype.
One of the cool things I like with all these JavaScript frameworks is the easy way they allow you to execute code on ‘DOM [...]