Site Archives Uncategorized

JAVASCRIPT: jQuery zoom event plugin


I don’t normally write code that I’m not ready to use, but I made an exception for this jQuery plugin.  It doesn’t really do all that I wanted it to do, but it’s good enough for a release.

JAVASCRIPT: The start of a jQuery zoom event handler


After much research and very little code, I’ve come up with a basic start to a jQuery zoom event handler.  Don’t laugh.  This is very basic, but it handles zoom events based on keyboard shortcuts and fires the handler.

JAVASCRIPT: Simple date conversion from SQL to readable


I needed a simple date converter function from SQL dates (YYYY-MM-DD) to something readable (M/D/YYYY).  So I wrote this little function.  Maybe someone else will have some use for it.

1
2
3
var makeSQLDatePretty = function(d) {
return d.replace(/([0-9]{4})-0?([0-9]{1,2})-0?([0-9]{1,2})/, ‘$2/$3/$1′);
};

Pass in a SQL date and the function trims leading zeros and returns a reformatted date.

1
2
var sqlDate = [...]

JAVASCRIPT: Smart, unobtrusive AJAX form submission with jQuery


A former coworker was telling me recently about MooTools and how the AJAX functions are so easy to use.  He sent me the following example:

JAVASCRIPT: Iterating through objects, the easy way


Objects in any ECMAScript language (Javascript, Actionscript, Jscript, etc) are very powerful for - among other things - storing data. However, getting some information out of these objects can be a hassle sometimes.
I ran into this issue recently and wrote some cool little handlers for objects. The following methods can be used to [...]

JAVASCRIPT: onerror image magic


HTML has a little-known event handler for <img> and <body> tags. I’m going to focus on <img> tags and how you can use this to clean up some 404s.

JAVASCRIPT: Internet Explorer’s attachEvent breaks ‘this’


First of all, let me just say that I love jQuery. It makes Javascript development so much faster. I’m sure that Prototype is just as easy for those that use that daily, but I prefer jQuery. And before you ask… Yes, I learned both.
That having been said, there are some applications where [...]

LEARNING: 2008 monthly plan updated


The learning plan has been canceled for now.  Between work, side work and a new baby, I really don’t have time to learn as a separate task.  I guess I’ll just have to learn as I go along.

LEARNING: 2008 monthly plan


Since it is the new year already, I’ve decided to plan my learning schedule for the next 12 months. Here’s the plan so far (subject to change):

January: JavaServer Pages
February: Java
March: Java (continued)
April: MySQL 5
May: MySQL 5 (continued)
June: SQLite
July: Python
August: Python (continued)
September: Perl
October: Perl (continued)
November: Ext
December: Ruby

These should really push me out of my comfort [...]

JAVASCRIPT: Method overloading


John Resig, one of my heroes and creator of the jQuery JavaScript library, wrote a great piece about overloading methods. He created a dead simple function that shoulders most of the work. Check it out:

1
2
3
4
5
6
7
8
9
function addMethod(object, name, fn){
var old = object[ name ];
object[ name ] = function(){
[...]