Browsing articles in "Work Life"

Use jQuery and Modernizr to load javascript conditionally, based on existence of DOM element

In the past year or so, Modernizr has really exploded on the web development scene. It allows the detection of browser abilities, such as geolocation, canvas, etc. Version 2 also merged with yepnope.js which allows for the conditional loading of CSS & JS. If you don’t know what Modernizr is, their site provides lots of clear documentation to show you its’ power. The one thing that wasn’t clear to me, was if I could load […]


How to use the jQuery plugin Colorbox from within an iframe

If you’ve ever needed a high quality lightbox and did some research, I’m sure you’ve come across the jQuery plugin Colorbox. It’s lightweight, themeable with just CSS, and very easy to use. I’ve been using it for a few years now, and have never had a reason to try something else. Anyway, I recently had to open up a Colorbox link from within an iframe, but in the parent window, not the iframe window. Lets […]


Super simple Javascript User Agent detection

I recently had the need to detect some mobile User Agents. If you’re not familiar with the topic, a User Agent is a piece of information that’s in every browser, desktop or mobile, which basically gives some data about it’s vendor and version. So you would be able to tell if a site visitor was using Firefox 4, Internet Explorer 8, or was on an iPhone for example. There are some very robust and complex […]


Syntax coloring, welcome to the dark side, maybe

Being a web worker, I find myself staring at walls of markup, code and text on a regular basis. As we all know, syntax highlighting and coloring plays a big part in making our lives easier. Editing a huge file of code in nothing but Notepad with black text would drive almost anyone crazy. A recent job change forced me to reevaluate my work space, to try and spice up my environment a little, while […]