WIP: try-catch JavaScript-exceptions in banner-codes
[openx] / jquery.openx.js
index 4b978b3..d02b228 100644 (file)
               /** Remove leading HTML-comments, because IE will stumble otherwise */
               inline = inline.slice(result[0].length,inline.length);
             }
-            $.globalEval(inline);
+            try {
+              $.globalEval(inline);
+            }
+            catch(e) {
+              if (console.error)
+                console.error('Error while executing inline script-code: ' + e.message);
+            }
             insert_output(); // << The executed inline-code might have called document.write()!
           }
           else {