阿里妈妈广告源码示例

来源:互联网 发布:咸阳师范学院教务网络 编辑:程序博客网 时间:2024/04/30 10:26

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

<!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)


0 0
原创粉丝点击