Tag Archives: jQuery

Getting A Class From a DOM Element

Lately, if I am searching for a way to do something in Javascript the only results I am getting ways of doing the procedure using jQuery. While, its true jQuery is pretty much the de facto standard for writing JavaScript anymore, understanding the underlying technology is a must. As well as alot of times, I [...]
Posted in Do This, Not That, JavaScript | Tagged as: , | 1 Comment

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: | 21 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

JavaScript Performance Testing – An Indispensable Tool

Over the course of the last couple of weeks I have been looking into various tools to test Javascript Pefromance. I needed a way to test various JavaScript code snippets to see the overall latency/run time of each. I started looking for a way to manage the tests and be able to reference them in [...]

Posted in Performance | Tagged as: , | 2 Comments

Underscore.js Templates

After the post about why Underscore.js, I think it is best to follow up on one of the best parts of the library. Now, I haven’t had a chance to go through the new templating in jQuery, however what I have found with Underscore.js has allowed me to complete some very complicated tasks in my [...]
Posted in JavaScript, Underscore.JS | Tagged as: , | 9 Comments

Underscore.js

Coming from a more technical backend role, and moving into JavaScript many people tend to look for very common functions to make their life easier. However, since JavaScript is considered a "functional" programming language, most of those little conveniences are currently unsupported. So I went searching a bit. Turns out there is a nice little [...]

Posted in JavaScript, Underscore.JS | Tagged as: , | 6 Comments

Finding an Element outside of your current iframe

Sometimes you are working within an iframe and need to be able to check for an element outside of that frame. It sounds simple enough, and you are right. The following bit of code grabs an element outside of your current iframe: if (typeof window.parent != "undefined"){ window.parent.document.getElementById("SOMEID"); } Pretty simple! Now, lets look at [...]
Posted in JavaScript | Tagged as: | Leave a comment