广告联盟网
标题:
大家能否给个随机显示淘宝广告的代码
[打印本页]
作者:
HELLO谷歌
时间:
2007-3-15
标题:
大家能否给个随机显示淘宝广告的代码
从网上搜到的都是随机显示图片广告的简单代码,换成淘宝的广告代码不能用。<br /><br />请大家赐教,最好简单说明一下怎么用。<br /><br />谢谢!
作者:
speed
时间:
2007-3-15
<SCRIPT LANGUAGE="JavaScript"><br />var tips = [<br /> '广告代码1<a href="http://www.spa-yoga.com/bbs/api/javascript.php?function=threads&fids=7&maxlength=30&startrow=0&picpre=&items=2&digest=0&newwindow=1&highlight=0&forum=0&author=0&dateline=0&orderby=lastpost&verify=a3f5df6e41f597f5a77e899e4211f586"" target="_blank">'</a>,<br /> '广告代码2<a href="http://www.spa-yoga.com/bbs/api/javascript.php?function=threads&fids=8&maxlength=30&startrow=0&picpre=&items=2&digest=0&newwindow=1&highlight=0&forum=0&author=0&dateline=0&orderby=lastpost&verify=47a2048f288c6cddd55db42c8c47c8ed"" target="_blank">'</a>,<br /> '广告代码3<a href="http://www.spa-yoga.com/bbs/api/javascript.php?function=threads&fids=9&maxlength=30&startrow=0&picpre=&items=2&digest=0&newwindow=1&highlight=0&forum=0&author=0&dateline=0&orderby=lastpost&verify=526699aece32eabd575787602e2e2a45"" target="_blank">'</a>,<br /> '广告代码4<a href="http://www.spa-yoga.com/bbs/api/javascript.php?function=threads&fids=10&maxlength=30&startrow=0&picpre=&items=2&digest=0&newwindow=1&highlight=0&forum=0&author=0&dateline=0&orderby=lastpost&verify=6280120dec8adf855e1afb322c187b38"" target="_blank">'</a>,<br /> '广告代码5<a href="http://www.spa-yoga.com/bbs/api/javascript.php?function=threads&fids=11&maxlength=30&startrow=0&picpre=&items=2&digest=0&newwindow=1&highlight=0&forum=0&author=0&dateline=0&orderby=lastpost&verify=27200b49f334c68a987a4cf8bc58e511"" target="_blank">'</a><br />];<br />var rnd = Math.round(Math.random()*(tips.length-1));<br />function setCookie(name, value) {<br /> document.cookie = name + "=" + escape(value) + ";domain=spa-yoga.com";<br /> var selType = document.getElementById("selType\<br /> var txtStyle = document.getElementById("txtStyle\<br /> switch(selType.value){<br /> case "js":<br /> txtStyle.value = "15";<br /> break;<br /> case "jy":<br /> txtStyle.value = "16";<br /> break;<br /> default:<br /> txtStyle.value = selType.value;<br /> }<br /> document.cookie = "logType="+ selType.value +";expires="+ (new Date(2099,12,31)).toGMTString() +";domain=spa-yoga.com";<br /> }<br />function fSetLogType(){<br /> var logType = getCookie("logType\<br /> var selType = document.getElementById("selType\<br /> switch(logType){<br /> case "js":<br /> selType.selectedIndex = "1";<br /> break;<br /> case "jy":<br /> selType.selectedIndex = "2";<br /> break;<br /> default:<br /> selType.selectedIndex = "0";<br /> }<br />}<br />function getCookie(name) {<br /> var search = name + "="<br /> if(document.cookie.length > 0) {<br /> offset = document.cookie.indexOf(search)<br /> if(offset != -1) {<br /> offset += search.length<br /> end = document.cookie.indexOf(";", offset)<br /> if(end == -1) end = document.cookie.length<br /> return unescape(document.cookie.substring(offset, end))<br /> }<br /> else return ""<br /> }<br />}<br />//--><br /></SCRIPT><br /> <br />好长,呵呵,用js调吧。
作者:
HELLO谷歌
时间:
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"><script><br />var YahooCNADConfig=new Array();<br />YahooCNADConfig['adid']=775<br />YahooCNADConfig['wid']=22560<br />YahooCNADConfig['w']=468<br />YahooCNADConfig['h']=60<br /></script><br /><script type='text/javascript' src='http://view.aliunion.cn.yahoo.com/showad.php'></script></div></div><br>这样的呢?我试了怎么不显示?
作者:
speed
时间:
2007-3-15
是直接放广告代码,我看见人家是用来调用论坛帖子都可以,他也是<script>。具体怎么,我也不是很清楚。帮不了你啦。
作者:
HELLO谷歌
时间:
2007-3-15
搞定了,再次感谢!
作者:
夏威夷海盗
时间:
2007-3-15
楼上怎么搞定的啊,PM一下或者分享下呢?
作者:
HELLO谷歌
时间:
2007-3-15
用这个代码就可以了 <br /><br /><SCRIPT LANGUAGE="JavaScript"><br /><!--<br /><br />//////// 广告数<br />shu = 7<br /><br />//////// 最前显示内容,代码将显示在广告代码上方.删掉代码也行.<br />ad1='<FONT color=#ff0000></FONT><br>'<br /><br />//////// 广告内容<br /><br />theAds = new Array();<br /><br />theAds[1] = "广告代码1";<br />theAds[2] = "广告代码2";<br />theAds[3] = "广告代码3";<br />theAds[4] = "广告代码4";<br />theAds[5] = "广告代码5";<br />theAds[6] = "广告代码6";<br />theAds[7] = "广告代码7";<br /><br />sx = parseInt(Math.random() * shu + 1);<br />document.write(ad1+theAds[sx]);<br />--></SCRIPT>
作者:
亡灵
时间:
2007-4-6
正想要,谢谢啦.
欢迎光临 广告联盟网 (https://bbs.ggads.com/)
Powered by Discuz! X3.2