inject document rather than using it as a global
upgraded to jquery2 beta with migrate