Prevent an error, if OA_source is not defined
authorKai Moritz <kai@coolibri.de>
Wed, 30 Jan 2013 10:32:00 +0000 (11:32 +0100)
committerKai Moritz <kai@juplo.de>
Wed, 27 Feb 2013 18:29:50 +0000 (19:29 +0100)
openx.js

index a442f0d..e074a9a 100644 (file)
--- 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);