阿里妈妈广告源码示例

这是一个很普遍的淘宝广告代码,具有定时刷新显示不同广告内容的功能。已做备忘。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD> 
	<style> html, body{ margin:0; padding:0; } </style>
</HEAD>
<BODY>
  
<script type="text/javascript">
     document.write('<a style="display:none!important" id="tanx-a-mm_26632206_2690592_14738448"></a>');
     tanx_s = document.createElement("script");
     tanx_s.type = "text/javascript";
     tanx_s.charset = "gbk";
     tanx_s.id = "tanx-s-mm_26632206_2690592_14738448";
     tanx_s.async = true;
     tanx_s.src = "http://p.tanx.com/ex?i=mm_26632206_2690592_14738448";
     tanx_h = document.getElementsByTagName("head")[0];
     if(tanx_h)tanx_h.insertBefore(tanx_s,tanx_h.firstChild);
	 setInterval( function () {
        location.reload();
     }, 10*60*1000);
</script>

</BODY>
</HTML>
广告的效果示意图是


js形式的代码片段

(function(w, d) {
    var o = {i: "mm_26632206_2690592_21024578",callback: "",userid: "",o: "",f: "",n: "",sd: "toruk.tanx.com"}, p = {c: 'gbk',s: 'http://cdn.tanx.com/t/tanxssp.js'};
    if (w.tanxssp_show) {
        w.tanxssp_show(o);
        return;
    }
    w.tanx_ssp_onload = w.tanx_ssp_onload || [];
    tanx_ssp_onload.push(o);
    if (d.getElementById('tanx-a-' + (o.i || ''))) {
        var s = d.createElement("script"), h = d.getElementsByTagName("head")[0];
        s.charset = p.c;
        s.async = true;
        s.src = p.s;
        h.insertBefore(s, h.firstChild);
    } else {
        d.write('<script charset="' + p.c + '" src="' + p.s + '"></script>');
    }
})(window, document)


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值