From: Kai Moritz Date: Tue, 26 Feb 2013 14:59:00 +0000 (+0100) Subject: Chained loading of /delivery/spc.php and /delivery/fl.js X-Git-Tag: 0.1.0~3 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=2f8a47c7005bad1aa61a5ae20617fd96426ee860;p=openx Chained loading of /delivery/spc.php and /delivery/fl.js Browsers, that load these two URL's scripts asynchronigly, might execute the delivered banner-codes, before fl.js is loaded completely and, hence, produce an error, if a banner-code referes code from fl.js. --- diff --git a/openx.js b/openx.js index e074a9a..4413e01 100644 --- a/openx.js +++ b/openx.js @@ -6,8 +6,7 @@ var - id, - node, + domain, id, node, count = 0, slots = {}, @@ -18,8 +17,9 @@ openx.show_ads = function(server, zones) { + domain = document.location.protocol == 'https:' ? 'https://' + server + ':8443':'http://' + server; + var - domain = document.location.protocol == 'https:' ? 'https://' + server + ':8443':'http://' + server, name, src = domain; @@ -56,10 +56,13 @@ if (window.location) src += "&loc=" + escape(window.location); if (document.referrer) src += "&referer=" + escape(document.referrer); - $.getScript(src, init_ads); + $.getScript(src, load_flash); + + } + + function load_flash() { - src = domain + '/www/delivery/fl.js'; - $.getScript(src); + $.getScript(domain + '/www/delivery/fl.js', init_ads); }