From: Kai Moritz Date: Thu, 7 Mar 2013 22:35:45 +0000 (+0100) Subject: WIP: try-catch JavaScript-exceptions in banner-codes X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;p=openx WIP: try-catch JavaScript-exceptions in banner-codes --- diff --git a/jquery.openx.js b/jquery.openx.js index 4b978b3..d02b228 100644 --- a/jquery.openx.js +++ b/jquery.openx.js @@ -417,7 +417,13 @@ /** 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 { diff --git a/openx.jquery.json b/openx.jquery.json index 54fb3cf..1f84139 100644 --- a/openx.jquery.json +++ b/openx.jquery.json @@ -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",