#1 try typeof $ === 'undefined'

http://stackoverflow.com/questions/2647867/how-to-determine-if-variable-is-undefined-or-null