diff --git a/purl.js b/purl.js index b5799c6..b2077cf 100644 --- a/purl.js +++ b/purl.js @@ -9,7 +9,7 @@ if (typeof define === 'function' && define.amd) { define(factory); } else { - window.purl = factory(); + this.purl = factory(); } })(function() { @@ -260,7 +260,9 @@ } }; - purl.jQuery(window.jQuery); + if ( typeof window !== 'undefined' ) { + purl.jQuery(window.jQuery); + } return purl;