Skip to content

Instantly share code, notes, and snippets.

@yurivictor
Created July 8, 2014 13:14
Show Gist options
  • Save yurivictor/83af5a3ad71ca4d3989d to your computer and use it in GitHub Desktop.
Save yurivictor/83af5a3ad71ca4d3989d to your computer and use it in GitHub Desktop.
OpenX async ad example
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">window.jQuery || document.write('<script src="http://cdn3.sbnation.com/javascripts/vendor/jquery-1.10.2.min.vda41706.js"><\/script>');</script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>
<script type="text/javascript">window._ || document.write('<script src="http://cdn1.sbnation.com/javascripts/vendor/underscore-1.5.2.min.vd22f881.js"><\/script>');</script>
</head>
<body>
Some content here.
Ad goes here.
<!-- Preserve space while the rest of the page loads. -->
<div id="placeholderId" style="width:728px;height:90px">
<!-- Fallback mechanism to use if unable to load the script tag. -->
<noscript>
<iframe id="4cb4e94bd5bb6" name="4cb4e94bd5bb6"
src="http://d.example.com/w/1.0/afr?auid=8&target=
_blank&cb=INSERT_RANDOM_NUMBER_HERE"
frameborder="0" scrolling="no" width="728"
height="90">
<a href="http://d.example.com/w/1.0/rc?cs=
4cb4e94bd5bb6&cb=INSERT_RANDOM_NUMBER_HERE"
target="_blank">
<img src="http://d.example.com/w/1.0/ai?auid=8&cs=
4cb4e94bd5bb6&cb=INSERT_RANDOM_NUMBER_HERE"
border="0" alt=""></a></iframe>
</noscript>
</div>
<!--Async ad request with multiple parameters.-->
<script type="text/javascript">
var OX_ads = OX_ads || [];
OX_ads.push({
"slot_id":"placeholderId",
"auid":"554717",
});
</script>
Some other content here.
<!-- Fetch the Tag Library -->
<script type="text/javascript" src="http://ox-d.sbnation.com/w/1.0/jstag"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment