Skip to content

Instantly share code, notes, and snippets.

@ryantss
Created April 8, 2010 11:16

Revisions

  1. ryantss created this gist Apr 8, 2010.
    45 changes: 45 additions & 0 deletions sample_afs.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    <html>
    <head>
    <title>[NEAT] Sample AFS Javascript Page</title>
    <style>
    body{ font-family:arial; }
    .search_header{ background:#eee; padding:4px; font-size:15px; font-weight:bold; }
    .wide_ads { background:#ddf8cc; padding:10px; }
    .narrow_ads { background:#e5ecf9; padding:10px; }

    /* WEGO AFS */
    div.ad_slot .ad .blurb { color:#333333; }
    div.ad_slot a { color:#0071BA; text-decoration:none; }
    div.ad_slot { font-size:12px; }
    </style>
    <script language="JavaScript">
    function renderWegoAFS(wideAds, narrowAds){
    document.getElementById("wide_ad_unit").innerHTML = '<div class="ad_slot">'+wideAds.join('<br>')+'</div>';
    document.getElementById("narrow_ad_unit").innerHTML = '<div class="ad_slot">'+narrowAds.join('<br>')+'</div>';
    }
    function renderNext(wideAds, narrowAds){
    document.getElementById("wide_ad_unit2").innerHTML = '<div class="ad_slot">'+wideAds.join('<br>')+'</div>';
    document.getElementById("narrow_ad_unit2").innerHTML = '<div class="ad_slot">'+narrowAds.join('<br>')+'</div>';
    }
    function loadNext(){
    document.getElementById('afs_iframe').src="wego_afs.html?q=Kuala+Lumpur&num_ads=w2n3&channel=Airfares&page=1&callback=renderNext";
    }
    </script>
    </head>
    <body>
    <table width="100%" border="0">
    <tr>
    <td colspan="4"><div class="search_header">Search Results&nbsp;
    <input type='button' value='load next page' onclick="loadNext()" />
    </div></td>
    </tr>
    <tr>
    <td style="width:35%;vertical-align:top">wide-1<br><div id="wide_ad_unit" class="wide_ads"><big><p>wide result...</p></big></div></td>
    <td style="width:15%;vertical-align:top">Narrow-1<br><div id="narrow_ad_unit" class="narrow_ads"><big><p>narrow result...</p></big></div></td>
    <td style="width:35%;vertical-align:top">Wide-2<br><div id="wide_ad_unit2" class="wide_ads"></div></td>
    <td style="width:15%;vertical-align:top">Narrow-2<br><div id="narrow_ad_unit2" class="narrow_ads"></div></td>
    </tr>
    </table>
    <iframe id='afs_iframe' style="display:none" src="wego_afs.html?q=New+York&num_ads=w3n2&channel=Airfares&page=1&callback=renderWegoAFS" height="0px" width="0px" border="0px"/>
    </body>
    </html>