safeframe
Version:
SafeFrame provides a consistent JS API to include 3rd party content
129 lines (105 loc) • 3.75 kB
HTML
<html>
<head>
<title>Billboard: Rising Stars with SafeFrame</title>
<link type="text/css" rel="stylesheet" href="samp.css" />
</head>
<body>
<div id="center">
<div id="topBar" >
<div id="contentLogo" class="mockContent"></div>
<div id="contentNav" class="mockContent">
<script type="text/javascript" src="risingstarnav.js" ></script>
</div>
</div>
<div id="adUnitWrapper" >
<div id="billboardAdDiv"></div>
</div>
<div id="contentTop" class="mockContent">
<h1>Billboard Rising Star Ad</h1>
</div>
<div id="contentRight" class="mockContent">
<div id="logger"></div>
</div>
<div id="contentLeft" class="mockContent">
<div>
<em>The Billboard is a large billboard running the full width of the page with full close-ability.</em>
<p>
In this example the Billboard ad pushes down page content to place itself front and center.
The user can close the ad by clicking the "Close" button to dismiss the ad.
A small "Show ad" link is left in case the user wishes to re-display the ad.
</p>
<ul>
<li>
<a href="http://www.iab.net/risingstars" target="_blank">... More on IAB Rising Star ad units</a>
</li>
<li><a href="https://code.google.com/p/iab-billboard-adunit/" target="_blank">Billboard sample files</a></li>
</ul>
</div>
</div>
<div id="contentBottom" class="mockContent"></div>
</div>
<!-- // "https://s3-us-west-2.amazonaws.com/safeframe/samples/rising_stars/adfiles/billboardAdBootstrap.js", -->
<script type='text/x-safeframe' class='sf_data'>
{
"id": "billboardAd",
// relative source is relative to the r.html bootstrap file "../../examples/IAB_RisingStars/AdFiles/billboardAdBootstrap.js",
// ALWAYS USE ABSOLUTE SOURCES
"src": "http://safeframes.emination.com/risingStars/adfiles/billboardAdBootstrap.js",
"conf":
{
"w": 970,
"h": 20,
"dest": "billboardAdDiv",
"supports" : {
"exp-push" : "1",
"read-cookie" : "1",
"write-cookie" : "1"
}
}
}
</script>
<!--
INCLUDES OF THE SAFEFRAMES FRAMEWORK
These script files should be hosted on your CDN from a different
top level domain from the host site.
-->
<!-- local version
<script type="text/javascript" src="../../src/js/lib/base.js"></script>
<script type="text/javascript" src="../../src/js/host/host.js"></script>
<script type="text/javascript" src="../../src/js/lib/boot.js"></script>
-->
<script type="text/javascript"
src="https://s3-us-west-2.amazonaws.com/safeframe/refimpl/1-0-3/js/lib/base.js"></script>
<script type="text/javascript"
src="https://s3-us-west-2.amazonaws.com/safeframe/refimpl/1-0-3/js/host/host.js"></script>
<script type="text/javascript"
src="https://s3-us-west-2.amazonaws.com/safeframe/refimpl/1-0-3/js/lib/boot.js"></script>
<script type="text/javascript">
function posMessageCallback(id, msgName, data){
if(msgName == "error"){
var log = document.getElementById("logger");
var msg = ["error in ad ", id];
if(data && data.errors){
msg.push(data.errors);
}
msg.push("<br/>");
log.innerHTML += msg.join("");
}
}
/**
* Initialize a new SafeFrames publisher configuration
*/
(function() {
var conf = new $sf.host.Config({
// Should be absolute path to render file hosted on CDN "../../src/html/r.html",
// "http://s3-us-west-2.amazonaws.com/safeframe/refimpl/1-0-3/html/r.html",
renderFile: "http://s3-us-west-2.amazonaws.com/safeframe/refimpl/1-0-3/html/r.html",
onPosMsg: posMessageCallback,
positions: {}
});
})();
</script>
<script type='text/javascript' src='http://safeframes.net/google_analytics_sfnet.js' ></script>
</body>
</html>