Category Archives: JavaScript

DOMContentLoaded Inconsistencies (in Browsers and JavaScript Libraries)

We all know the problem, but we may not all call it the same thing: DOMContentLoaded. Every popular JavaScript library has its own name for the DOMContentLoaded event, and they're all implemented differently. This, of course, partly due to the fact that web browsers are also inconsistent in their implementations. Here's a run-down of those inconsistencies.
Also posted in Web Browsers | Tagged |

Emulating onhashchange without setInterval

There is one limitation that all of the major JavaScript browser history management plugins have to hack around: How to tell when there is a change to the location.hash? Sure, you can tell when you’re modifying the hash yourself, but what if the user hits the back/forward button? YUI’s History component and Really Simple History [...]
Posted in JavaScript | Tagged , , |

Selecting XML Nodes with JavaScript (Peril of getElementsByTagName)

Parsing XML in the browser can be a tricky beast. There are many different wrong ways to do it, which can leave you cold and naked in a snowstorm if you're not careful. So, let's put on the metaphorical electric one-sie of standards based code and let the power of Edison heat our JavaScript code like the innards of a tauntaun.
Posted in JavaScript | Tagged , , |

Javascript Objects are NOT JSON

The headline should more accurately read “Javascript Objects are not necessarily JSON.” But that waters it down a bit, don’t you think? I know this has been posted a few times before, but this is not something I knew until recently, and after learning it, have noticed quite a few other people doing it wrong [...]
Posted in JavaScript | Tagged |

Surnamespacing

Everyone has a library. Everyone has their own utility classes and functions they're using in their own personal and contracted projects. And now that everyone has a blog too, they're all releasing their libraries as open source, using the commando underoo philosophy of wild, free, and unrestricted naming schemes for their code. Not anymore. Let's surnamespace.
Also posted in Humor, Java, PHP |

Don’t Let the Door Hit You Onunload and Onbeforeunload

Many people attempt a last ditch effort to save page state in the browser by using the onunload or onbeforeunload events. This has been studied at great length by Patrick Hunlock, who uses the perhaps now common knowledge of using a Synchronous Ajax call to perform the page state save. Another use for the onbeforeunload [...]
Also posted in Interface Design, Web Browsers | Tagged , , , |

Rethinking JavaScript Grids and DataTables

In the world of front end engineering, one must consider the end-user of the interface first, and above all other things. The priorities should not start with development ease, nor external library preference. The priorities should start with the needs of the consumer of your end product. Evolution of your engineering skill is also a [...]
Also posted in Interface Design | Tagged , , , , , |

ALARMd 2 Beta, with Google Calendar Integration

Take a look: ALARMd 2 Beta Update: added Metric and Unit Circle time formats. I know, some of you are reading this and thinking to yourself — genital herpes is more appealing than yet another online alarm clock. But to that I say, congratulations, that’s one of the new features in ALARMd 2! Why did [...]
Also posted in Interface Design, Projects | Tagged , , , |