Archive for the 'code' Category

Tracking File Downloads Automatically in Google Analytics with Prototype

Wednesday, October 3rd, 2007

I wrote this Javascript after seeing this Google Analytics tip: http://www.google.com/support/googleanalytics/bin/answer.py?answer=55529&topic=11006.

Having onclicks on the anchors in the markup is messy and tedious to maintain. My code dynamically does this. It’s pretty simple. As long as this code is executed after the ‘contentloaded’ event, it will work. Also, the Javascript is dependent on Prototype.

$w(‘mp3 pdf [...]

How to Build Prototype From the Latest Trunk With Subversion

Wednesday, January 10th, 2007

This assumes you have basic knowledge of Subversion.

Install a Subversion client. (Windows users should get Tortoise SVN).
Install Ruby 1.8.2 or higher (http://www.ruby-lang.org/) and Rake —Ruby Make (http://rake.rubyforge.org/).
Make a new folder and title it “Prototype“.
Inside of that folder, checkout the latest trunk of Prototype from “http://dev.rubyonrails.org/svn/rails/spinoffs/prototype“.
Open the README and follow the instructions under “Building Prototype from [...]

I like my office.

Thursday, September 21st, 2006

/sigh

Sorting a Table with Javascript

Saturday, April 1st, 2006

View the Table Sorting DemoThis example uses the Prototype Javascript library (1.5.0_pre1). It’s not an official release yet, so you will see IE exhibiting some bugs.

I think this demo is a good example of how easy it is to use Prototype to do simplify complex tasks. Prototype functions used are: $$(), $A(), [...]

Drop down menu with Prototype

Wednesday, March 29th, 2006

View the demo

Prototype and Sergio Pereira’s excellent documentation of it has made client-side scripting with JavaScript actually fun! JavaScript can be intimidating. DOM manipulation is a beast, especially to those exposed to how easy it is to program ActionScript! Browser differences further complicate matters. I’ll quote from Sergio, “This amazingly well [...]