1、首先将妈妈广告位建成待加载广告位,放在页面中要实际显示广告的地方,具体代码参考下面:
<SPAN id="index_200_ali_header" >阿里妈妈数据载入中,请稍后...</SPAN>
2、建立加载代码,放在页面的"</html>"后面,具体代码参考如下:
<span id="index_200_ali_footer">
<script language="javascript" type="text/javascript" src="class/alimm200.js"></script>
<script language="javascript" type="text/javascript">
document.getElementById("index_200_ali_header").innerHTML = document.getElementById("index_200_ali_footer").innerHTML;
document.getElementById("index_200_ali_footer").innerHTML = "";
</script>
3、创建具体的广告JS文件,即2中的 alimm200.js,如:
document.writeln("<script type="text/JavaScript">");
document.writeln("alimama_pid="mm_10228397_295104_2250390";");
document.writeln("alimama_titlecolor="0044DD";");
document.writeln("alimama_descolor ="275689"; ");
document.writeln("alimama_bgcolor="FFFFFF";");
document.writeln("alimama_bordercolor="E1E1E1";");
document.writeln("alimama_linkcolor="C1C1C1";");
document.writeln("alimama_bottomcolor="FFFFFF";");
document.writeln("alimama_anglesize="10";");
document.writeln("alimama_bgpic="0";");
document.writeln("alimama_icon="0";");
document.writeln("alimama_sizecode="35";");
document.writeln("alimama_width=200; ");
document.writeln("alimama_height=200; ");
document.writeln("alimama_type=2; ");
document.writeln("</script>");
document.writeln("<script src="http://a.alimama.cn/inf.js" type=text/javascript>");
document.writeln("</script>");
这样就会在页面加载完之后再加载阿里妈妈的广告了。如果页面里面没有步骤1的代码,那么广告就会出现在页面最下方。