diff --git a/src/end_scope.txt b/src/end_scope.txt index b79ac1a4..557dee6e 100644 --- a/src/end_scope.txt +++ b/src/end_scope.txt @@ -1,2 +1,9 @@ -global.easyXDM = easyXDM; -})(window, document, location, window.setTimeout, decodeURIComponent, encodeURIComponent); \ No newline at end of file +if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(easyXDM); +} +else { + // Browser globals + global.easyXDM = easyXDM; +} +})(window, document, location, window.setTimeout, decodeURIComponent, encodeURIComponent);