I’m John K. Paul
an engineering manager
and a speaker

found on

contact at

john@johnkpaul.com

about me

Often an engineering manager, with many more interests than that

Subscribe to the Monthly Newsletter

powered by TinyLetter

What Is Hoisting, Really?

- - | Comments

I use the word “hoisting” in relation to JavaScript pretty often. I’ve even written a blog post about how it’s one of the difficult parts of JavaScript to learn. In reality, hoisting isn’t part of JavaScript at all. There is no feature in the specification called hoisting, so I’ve decided to figure out what it really is.

You can find a lot of good information about hoisting over at Nettuts and Ben Cherry’s blog. In case you haven’t come across it before, hoisting is how JavaScript developers describe the existence of certain references before they seem to be declared. For example:

Handling fbAsyncInit? - Use $.Deferred()

- - | Comments

I’m excited to have come across a straightforward example of a practical usage of $.Deferred that has nothing to do with ajax calls.

I’ve seen an assortment of hacks to handle the complexity needed handle what code needs to be run after the Facebook JS SDK has been loaded onto a web page.

There are long lists of callbacks.

There are global booleans.

Handling Good Old IE: Backbone History With pushState Fallback

- - | Comments

You’re using pushState with Backbone’s history manager? I bet you’re doing something like this…

This works just fine most of the time. For browsers where pushState is available, everything works seamlessly with the URL. For browsers without pushState, again, everything works fine using the url fragment If you start sharing URLs between these two browsers, problems start cropping up and I recently came across this issue when working with the Facebook Like/Send buttons.