ReSpec fix for better browser compatibility -- fixes "console not defined" problem
authorRichard Cyganiak <richard@cyganiak.de>
Thu, 02 Jun 2011 19:46:32 +0100
changeset 31 a5a0926066fb
parent 30 83cad8acf30d
child 32 5729240838d4
ReSpec fix for better browser compatibility -- fixes "console not defined" problem
ReSpec.js/js/respec.js
--- a/ReSpec.js/js/respec.js	Thu Jun 02 18:19:27 2011 +0200
+++ b/ReSpec.js/js/respec.js	Thu Jun 02 19:46:32 2011 +0100
@@ -221,7 +221,7 @@
         catch (e) {
             document.body.style.display = "inherit";
             error("Processing error: " + e);
-            if (console !== undefined && console.log) console.log(e);
+            window.console && console.log && console.log(e);
         }
         document.body.style.display = "inherit";
     },
@@ -935,7 +935,7 @@
         var header;
         if (this.specStatus === "finding" || this.specStatus === "draft-finding") header = this.makeTAGHeaders();
         else header = this.makeNormalHeaders();
-        console.log(header);
+        window.console && console.log && console.log(header);
         var tmp = sn.element("div");
         tmp.innerHTML = header;
         document.body.insertBefore(tmp.firstChild, document.body.firstChild);