Created
January 10, 2014 10:36
-
-
Save thoslin/8349810 to your computer and use it in GitHub Desktop.
Asynchronously load openx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript"> | |
var adQueue = []; | |
var OA_show = function(position, output) { | |
// queue the function call and create a place holder | |
adQueue.push([position, output]); | |
document.write("<div id='_"+position+"'></div>"); | |
} | |
</script> | |
</head> | |
<body> | |
<div id="top_banner"> | |
<script type='text/javascript'> | |
OA_show('top_banner', true); | |
</script> | |
</div> | |
<script type="text/javascript"> | |
var OA_zones = { | |
'top_banner': 120 | |
} | |
</script> | |
<script type='text/javascript' src='http://ads.example.com/www/delivery/spcjs.php?id=7'></script> | |
<script type='text/javascript'> | |
// queue out function calls and display ads | |
while(adQueue.length > 0) { | |
var args = adQueue.shift(); | |
var ad = OA_show(args[0], false); | |
if(ad){ | |
$("#_"+args[0]).html(ad); | |
} | |
} | |
</script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript"> | |
var OA_zones = { | |
'top_banner': 120 | |
} | |
</script> | |
<!-- the script will issue a request to fetch the ads --> | |
<script type='text/javascript' src='http://ads.example.com/www/delivery/spcjs.php?id=7'></script> | |
</head> | |
<body> | |
<div id="top_banner"> | |
<script type='text/javascript'> | |
// openx document.write the ad content | |
OA_show('top_banner', true); | |
</script> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment