jQuery as a Global Event Bus

Some time ago, I made a mistake. 1  Rather than taking the time to truly understand how events worked in jQuery, I built my own JavaScript library to handle event delegation.

It worked, but why reinvent the wheel?

It turns out jQuery is perfectly capable of serving as a global event bus for all of your code.  You just have to know how to use it. [Read more…]

Notes:

  1. Actually, I make mistakes quite often. Daily in fact. But let’s not dwell on this …

The Anatomy of an Exploit

I’m a huge fan of security. I spend many a weekend experimenting with new encryption techniques, hash algorithms, and security protocols.

As a result, I also come across several different server exploits in the wild. PHP hacks, .htaccess hacks, JavaScript injection, etc. I once even saw a server hacked through a corrupt PNG image that installed a PHP console when it was loaded.

To a new developer, is is all pretty scary stuff. Here’s an example of an exploit I came across last week – and how to both prevent and recover from it. [Read more…]

Javascript Event Listeners

Most websites today are stuck in the mud.

They sit there, present content, and fail to solicit any interaction from the user.  This site is no exception.  I write content, you read it.  End of story.

But some websites are far more interactive.  They present rich, immersive interfaces and simulate the kind of interactive behavior typical of desktop applications.

I build this second category of websites for a living.  And at times it can be tricky to wire the right kind of functionality to the right element.

Let’s walk step-by-step through an example of adding users from a dynamic database to an invite list as an example. [Read more…]