UNPKG

safeframe

Version:

SafeFrame provides a consistent JS API to include 3rd party content

87 lines (64 loc) 1.81 kB
<html> <head> <title>Safe Frame Sample Doubleclick </title> <style type="text/css"> body{ border: 0; margin: 0; padding: 0; font: Arial; } .title{ margin-top: 10px; font-size: 1.3em; } </style> </head> <body> <!-- This is the target div for the SafeFrame ad. We pre-initialize style to avoid page jerkiness, but this will be overwritten by SafeFrames --> <div id="top_leaderboard" style="height:90px;"></div> <div style="margin:10px;"> <div class="title">Safe Frames Doubleclick Ad</div> Example embedding of a leaderboard ad using the SafeFrames framework.<br/> The ad will display shortly. </div> <!-- type="text/x-safe-frame" --> <!-- TAG based safe frames follow strict parsing rules imposed by window.JSON.parse. Keys MUST be inside double quote marks. Javascript allows a much looser syntax for JSON objects --> <script type='text/x-safeframe' class='sf_data' id="sf_tag_1" > { "id" : "ad1Leader", "src" : "http://ad.doubleclick.net/N3790/adj/iab.net;sz=728x90", "conf" : { "size" : "728x90", "dest": "top_leaderboard" } } </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. --> <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"> /** * Initialize a new SafeFrames publisher configuration */ (function() { var conf = new $sf.host.Config({ // Should be absolute path to render file hosted on CDN renderFile: "../src/html/r.html", positions: {} }); })(); </script> </body> </html>