Also, wouldn't `window.jQuery !== undefined` work as well here (and be a bit simpler)?