use typeof to check existence of variables. Fix window variable name typo
Merge pull request #1 from jrf0110/1-bug-define-undefined

Uncaught ReferenceError: define is not defined