瀏覽代碼

Also handle case where AMD is not present

JC Brand 12 年之前
父節點
當前提交
d38af7ed89
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      Libraries/strophe.muc.js

+ 5 - 0
Libraries/strophe.muc.js

@@ -12,6 +12,9 @@
 
 // AMD/global registrations
 (function (root, factory) {
+    if (console===undefined || console.log===undefined) {
+        console = { log: function () {}, error: function () {} };
+    }
     if (typeof define === 'function' && define.amd) { 
         define([
             "Libraries/strophe"
@@ -22,6 +25,8 @@
                 return factory(jQuery, console);
             }
         );
+    } else { 
+        return factory(jQuery, console);
     }
 }(this, function ($, console) {