Category Archives: jQuery

jQuery ready, delegate, live!

Recently I was browsing through the jQuery subr reddit and noticed this question pop up. Since I am sure this is a pretty common question on "Why won't my jQuery command work properly", I figured I would give a shot at answering it. Hey guys, I'm sure this has been answered before but I can't [...]
Posted in jQuery | Tagged as: , , | 2 Comments

Writing and Updating DOM Elements in a Frame

Handling writing and updating objects in an iframe can be bothersome in most browsers. Sure things like jQuery tend to help, but not always. A normal way to access a frame in jQuery is below: $("#FRAME").contents() Now, lets say you actually want to get another element inside of the frame, lets get the HEAD element. [...]
Posted in JavaScript, jQuery | Tagged as: , | Leave a comment

Expanding the jQuery Plugin Development Pattern

Doing research on a recent project, I came across an article by Mike Alsup on a "jQuery Plugin Development Pattern". If you haven't seen it already its worth a trip to learningjquery.com to checkout the implementation of his pattern. "There are a few requirements that I feel this pattern handles nicely:" Claim only a single [...]
Posted in jQuery | Tagged as: | 19 Comments

jQuery 1.5 Deferreds

Eric Hynds on his blog the other day gave a very good run down of jQuery 1.5 Deferreds. From the post: Deferreds, new in jQuery 1.5, decouple logic dependent on the outcome of a task from the task itself. They’re nothing new to the JavaScript scene; Mochikit and Dojo have implemented them for some time, [...]
Posted in jQuery, Underscore.JS | Tagged as: | Leave a comment

$(“#ID”) is fast enough

We all know that the fastest selector to use is the ID. Something like $("#id") is better than using a class. However, after looking at the last test we did on The Great Assumption - JavaScript I noticed a large discrepancy in $("#ID") versus the native document.getElementById(). Now, I always assumed it was slower, but [...]
Posted in Do This, Not That, jQuery, Performance | Tagged as: , | 6 Comments

The Great Assumption – Javascript

A couple of weeks ago I was sitting down with a Google Frontend Engineer friend of mine, talking about some of the JavaScript best practices we all have come to know and abide by. I found myself in agreement with 90% of everything we were talking about. However, something kept eating at me. Why do [...]
Posted in Do This, Not That, jQuery, Performance | Tagged as: , | Leave a comment

Custom Events in jQuery

*quick note: I originally posted this on trulyevil.com. However its time to move sites and actually keep something up and running for a while. Events seem daunting at first, but really jQuery makes them super simple. Events can be used to alter behavior or even have multiple events happen on a single state change. We [...]
Posted in jQuery | Tagged as: | 6 Comments