广告联盟网

 找回密码
 注册
查看: 1400|回复: 7
打印 上一主题 下一主题

大家能否给个随机显示淘宝广告的代码

[复制链接]
跳转到指定楼层
1#
发表于 2007-3-15 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
从网上搜到的都是随机显示图片广告的简单代码,换成淘宝的广告代码不能用。<br /><br />请大家赐教,最好简单说明一下怎么用。<br /><br />谢谢!
8#
发表于 2007-4-6 | 只看该作者
正想要,谢谢啦.
7#
 楼主| 发表于 2007-3-15 | 只看该作者
用这个代码就可以了 <br /><br />&lt;SCRIPT LANGUAGE=&quot;JavaScript&quot;&gt;<br />&lt;!--<br /><br />//////// 广告数<br />shu = 7<br /><br />//////// 最前显示内容,代码将显示在广告代码上方.删掉代码也行.<br />ad1='&lt;FONT color=#ff0000&gt;&lt;/FONT&gt;&lt;br&gt;'<br /><br />//////// 广告内容<br /><br />theAds = new Array();<br /><br />theAds[1] = &quot;广告代码1&quot;;<br />theAds[2] = &quot;广告代码2&quot;;<br />theAds[3] = &quot;广告代码3&quot;;<br />theAds[4] = &quot;广告代码4&quot;;<br />theAds[5] = &quot;广告代码5&quot;;<br />theAds[6] = &quot;广告代码6&quot;;<br />theAds[7] = &quot;广告代码7&quot;;<br /><br />sx = parseInt(Math.random() * shu + 1);<br />document.write(ad1+theAds[sx]);<br />--&gt;&lt;/SCRIPT&gt;
6#
发表于 2007-3-15 | 只看该作者
楼上怎么搞定的啊,PM一下或者分享下呢?
5#
 楼主| 发表于 2007-3-15 | 只看该作者
搞定了,再次感谢!
4#
发表于 2007-3-15 | 只看该作者
是直接放广告代码,我看见人家是用来调用论坛帖子都可以,他也是&lt;script&gt;。具体怎么,我也不是很清楚。帮不了你啦。
3#
 楼主| 发表于 2007-3-15 | 只看该作者
谢谢楼上。<br /><br />是不是把<br><br><div class="msgbody"><div class="msgheader"><div class="right"><a href="###" class="smalltxt" onclick="copycode($('code0'));">[Copy to clipboard]</a> <a class="smalltxt" href="###" onclick="toggle_collapse('code0');">[ <span id="code0_symbol">-</span> ]</a></div>CODE:</div><div class="msgborder" id="code0">'广告代码1',<br />'广告代码2',<br />'广告代码3',<br />'广告代码4',<br />'广告代码5'</div></div><br>可以直接替换成<br><br><div class="msgbody"><div class="msgheader"><div class="right"><a href="###" class="smalltxt" onclick="copycode($('code1'));">[Copy to clipboard]</a> <a class="smalltxt" href="###" onclick="toggle_collapse('code1');">[ <span id="code1_symbol">-</span> ]</a></div>CODE:</div><div class="msgborder" id="code1">&lt;script&gt;<br />var YahooCNADConfig=new Array();<br />YahooCNADConfig['adid']=775<br />YahooCNADConfig['wid']=22560<br />YahooCNADConfig['w']=468<br />YahooCNADConfig['h']=60<br />&lt;/script&gt;<br />&lt;script type='text/javascript' src='http://view.aliunion.cn.yahoo.com/showad.php'&gt;&lt;/script&gt;</div></div><br>这样的呢?我试了怎么不显示?
2#
发表于 2007-3-15 | 只看该作者
&lt;SCRIPT LANGUAGE=&quot;JavaScript&quot;&gt;<br />var tips = [<br /> '广告代码1<a href="http://www.spa-yoga.com/bbs/api/javascript.php?function=threads&amp;fids=7&amp;maxlength=30&amp;startrow=0&amp;picpre=&amp;items=2&amp;digest=0&amp;newwindow=1&amp;highlight=0&amp;forum=0&amp;author=0&amp;dateline=0&amp;orderby=lastpost&amp;verify=a3f5df6e41f597f5a77e899e4211f586&quot;" target="_blank">'</a>,<br /> '广告代码2<a href="http://www.spa-yoga.com/bbs/api/javascript.php?function=threads&amp;fids=8&amp;maxlength=30&amp;startrow=0&amp;picpre=&amp;items=2&amp;digest=0&amp;newwindow=1&amp;highlight=0&amp;forum=0&amp;author=0&amp;dateline=0&amp;orderby=lastpost&amp;verify=47a2048f288c6cddd55db42c8c47c8ed&quot;" target="_blank">'</a>,<br /> '广告代码3<a href="http://www.spa-yoga.com/bbs/api/javascript.php?function=threads&amp;fids=9&amp;maxlength=30&amp;startrow=0&amp;picpre=&amp;items=2&amp;digest=0&amp;newwindow=1&amp;highlight=0&amp;forum=0&amp;author=0&amp;dateline=0&amp;orderby=lastpost&amp;verify=526699aece32eabd575787602e2e2a45&quot;" target="_blank">'</a>,<br /> '广告代码4<a href="http://www.spa-yoga.com/bbs/api/javascript.php?function=threads&amp;fids=10&amp;maxlength=30&amp;startrow=0&amp;picpre=&amp;items=2&amp;digest=0&amp;newwindow=1&amp;highlight=0&amp;forum=0&amp;author=0&amp;dateline=0&amp;orderby=lastpost&amp;verify=6280120dec8adf855e1afb322c187b38&quot;" target="_blank">'</a>,<br /> '广告代码5<a href="http://www.spa-yoga.com/bbs/api/javascript.php?function=threads&amp;fids=11&amp;maxlength=30&amp;startrow=0&amp;picpre=&amp;items=2&amp;digest=0&amp;newwindow=1&amp;highlight=0&amp;forum=0&amp;author=0&amp;dateline=0&amp;orderby=lastpost&amp;verify=27200b49f334c68a987a4cf8bc58e511&quot;" target="_blank">'</a><br />];<br />var rnd = Math.round(Math.random()*(tips.length-1));<br />function setCookie(name, value) {<br />&nbsp;&nbsp;document.cookie = name + &quot;=&quot; + escape(value) + &quot;;domain=spa-yoga.com&quot;;<br />&nbsp;&nbsp;var selType = document.getElementById(&quot;selType\<br />&nbsp;&nbsp;var txtStyle = document.getElementById(&quot;txtStyle\<br />&nbsp;&nbsp;switch(selType.value){<br />&nbsp; &nbsp;case &quot;js&quot;:<br />&nbsp; &nbsp; txtStyle.value = &quot;15&quot;;<br />&nbsp; &nbsp; break;<br />&nbsp; &nbsp;case &quot;jy&quot;:<br />&nbsp; &nbsp; txtStyle.value = &quot;16&quot;;<br />&nbsp; &nbsp; break;<br />&nbsp; &nbsp;default:<br />&nbsp; &nbsp; txtStyle.value = selType.value;<br />&nbsp;&nbsp;}<br />&nbsp;&nbsp;document.cookie = &quot;logType=&quot;+ selType.value +&quot;;expires=&quot;+&nbsp;&nbsp;(new Date(2099,12,31)).toGMTString() +&quot;;domain=spa-yoga.com&quot;;<br /> }<br />function fSetLogType(){<br /> var logType = getCookie(&quot;logType\<br /> var selType = document.getElementById(&quot;selType\<br /> switch(logType){<br />&nbsp;&nbsp;case &quot;js&quot;:<br />&nbsp; &nbsp;selType.selectedIndex = &quot;1&quot;;<br />&nbsp; &nbsp;break;<br />&nbsp;&nbsp;case &quot;jy&quot;:<br />&nbsp; &nbsp;selType.selectedIndex = &quot;2&quot;;<br />&nbsp; &nbsp;break;<br />&nbsp;&nbsp;default:<br />&nbsp; &nbsp;selType.selectedIndex = &quot;0&quot;;<br /> }<br />}<br />function getCookie(name) {<br />&nbsp; &nbsp;var search = name + &quot;=&quot;<br />&nbsp; &nbsp;if(document.cookie.length &gt; 0) {<br />&nbsp; &nbsp;&nbsp; &nbsp;offset = document.cookie.indexOf(search)<br />&nbsp; &nbsp;&nbsp; &nbsp;if(offset != -1) {<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;offset += search.length<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;end = document.cookie.indexOf(&quot;;&quot;, offset)<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if(end == -1) end = document.cookie.length<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;return unescape(document.cookie.substring(offset, end))<br />&nbsp; &nbsp;&nbsp; &nbsp;}<br />&nbsp; &nbsp;&nbsp; &nbsp;else return &quot;&quot;<br />&nbsp; &nbsp;}<br />}<br />//--&gt;<br />&lt;/SCRIPT&gt;<br /> <br />好长,呵呵,用js调吧。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|广告联盟网  

GMT, 2024-11-23 , Processed in 0.062036 second(s), 20 queries .

Powered by Discuz! X3.2

© 2005-2021 www.ggads.com GGADS 广告联盟网

快速回复 返回顶部 返回列表