From: Kai Moritz Date: Wed, 30 Jan 2013 10:32:00 +0000 (+0100) Subject: Prevent an error, if OA_source is not defined X-Git-Tag: 0.1.0~4 X-Git-Url: https://juplo.de/gitweb/?a=commitdiff_plain;ds=sidebyside;h=85b8e0cc15c980368286f8a84444e5b7eca8e8b3;p=openx Prevent an error, if OA_source is not defined --- diff --git a/openx.js b/openx.js index a442f0d..e074a9a 100644 --- a/openx.js +++ b/openx.js @@ -48,8 +48,9 @@ }); } - src += "&nz=1&source=" + escape(OA_source); - src += "&r=" + Math.floor(Math.random()*99999999); + if (typeof OA_source !== 'undefined') + src += "&source=" + escape(OA_source); + src += "&nz=1&r=" + Math.floor(Math.random()*99999999); src += "&block=1&charset=UTF-8"; if (window.location) src += "&loc=" + escape(window.location);