WIP: try-catch JavaScript-exceptions in banner-codes master
authorKai Moritz <kai@juplo.de>
Thu, 7 Mar 2013 22:35:45 +0000 (23:35 +0100)
committerKai Moritz <kai@juplo.de>
Thu, 7 Mar 2013 22:35:45 +0000 (23:35 +0100)
jquery.openx.js
openx.jquery.json

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 {
index 54fb3cf..1f84139 100644 (file)
@@ -3,7 +3,7 @@
   "title": "jQuery OpenX",
   "description": "jQuery plugin, that loads banner-ads from an OpenX-server in an asynchronous and responsive way",
   "keywords": [ "openx", "adserver", "banner", "asynchrone", "responsive" ],
-  "version": "0.2.1",
+  "version": "0.2.2",
   "author": { "name": "Kai Moritz", "email": "kai@juplo.de" },
   "licenses": [ { "type": "LGPLv3", "url": "http://www.gnu.org/licenses/lgpl-3.0.html" } ],
   "homepage": "http://juplo.de/openx",