广告联盟网

标题: 大家能否给个随机显示淘宝广告的代码 [打印本页]

作者: HELLO谷歌    时间: 2007-3-15
标题: 大家能否给个随机显示淘宝广告的代码
从网上搜到的都是随机显示图片广告的简单代码,换成淘宝的广告代码不能用。<br /><br />请大家赐教,最好简单说明一下怎么用。<br /><br />谢谢!
作者: speed    时间: 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调吧。
作者: 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">&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>这样的呢?我试了怎么不显示?
作者: speed    时间: 2007-3-15
是直接放广告代码,我看见人家是用来调用论坛帖子都可以,他也是&lt;script&gt;。具体怎么,我也不是很清楚。帮不了你啦。
作者: HELLO谷歌    时间: 2007-3-15
搞定了,再次感谢!
作者: 夏威夷海盗    时间: 2007-3-15
楼上怎么搞定的啊,PM一下或者分享下呢?
作者: HELLO谷歌    时间: 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;
作者: 亡灵    时间: 2007-4-6
正想要,谢谢啦.




欢迎光临 广告联盟网 (https://ggads.com/) Powered by Discuz! X3.2