问题描述
说明:这个js程序是新浪小游戏中,现在想修改它,但出错了,请高手帮助,主要是javascript和html中Div定位问题,烦了好几天了.程序和演示地址为:实现功能:1,换广告,其它都不变,效果要与"未修改时效果"一样.2,修改后的页面是"flash"下载完成后,广告隐藏,flash出现.3,修改这个的原因是他支持所有浏览器.修改好后,请发邮件到webmaster@sharedspider.com,谢谢了大家了.中国很多小游戏网站都无法满足所有浏览器的支持,新浪可以,希望高手帮助,相信很多人会感谢你....
解决方案
解决方案二:
呵呵,学习。。。接分。
解决方案三:
楼主早日成功。。。
解决方案四:
贴代码吧!第一页:flash.html<tablealign=centerstyle="border:1pxsolid#7CC0FF;margin-top:5px"cellspacing=0cellpadding=0width="100%"><tr><td><divalign=center><scriptlanguage="JavaScript">ssrc="http://www.spiderexcel.com/e9a8a381143e4ce09cc72e88e7b8c0ee.swf";width="640";height="465";</script><scriptlanguage=javascriptsrc="swfshow.js"></script></div></td></tr></table>js文件:swfshow.jsad_src="http://i3.sinaimg.cn/gm/iframe/casual/littlegame/guangg/U1850P115T18D6379F1274DT20090306193008.JPG";//广告图片地址,jpg或gif格式,640x480ad_url="http://sina.allyes.com/main/adfclick?db=sina&bid=150197,189093,194072&cid=0,0,0&sid=181808&advid=1832&camid=26012&show=ignore&url=http://adsresult.joywell.com.cn/count/stat_click.aspx?RD=8120&CD=84&AD=8106&MD=71&LD=491&AL=http://ys.10sea.com/index.shtml?adcode=00000000450000000177";//广告监测和链接//广告配置结束urlcnc=ssrc;if(ssrc.indexOf("ttp://")>0){ssrc0=ssrc;ssrc1=ssrc;ssrc2=ssrc;ssrc3=ssrc;ssrc4=ssrc;}else{ssrc0=""+ssrc;ssrc1=""+ssrc;ssrc2=""+ssrc;ssrc3=""+ssrc;ssrc4=""+ssrc;}rnd.today=newDate();rnd.seed=rnd.today.getTime();functionrnd(){rnd.seed=(rnd.seed*9301+49297)%233280;returnrnd.seed/(233280.0);};functionrand(number){returnMath.ceil(rnd()*number);}varrand_num=rand(4);ssrc=eval("ssrc"+(rand_num-1))if(ssrc.indexOf(".dcr")!=-1||ssrc.indexOf(".dir")!=-1){if(ssrc.indexOf(".dcr")!=-1){document.write("<objectclassid='clsid:166B1BCA-3F9C-11CF-8075-444553540000'codebase='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,0,0,0'width='"+width+"'name=gameyesflashid=gameyesflashheight='"+height+"'style='border:0solid#CEBE90'><paramname='src'value='"+ssrc+"'><paramname=swStretchStylevalue=fill><embedsrc='"+ssrc+"'width='"+width+"'height='"+height+"'pluginspage='http://www.macromedia.com/shockwave/download/'name=gameyesflashid=gameyesflash></embed></object>")}else{document.write("<EMBEDsrc='"+ssrc+"'width='566'name=gameyesflashid=gameyesflashheight='450'style='border:0solid#CEBE90'type=application/x-shockwave-flash>")}/**/document.write('<spanid="ads"></span>')}if(ssrc.indexOf(".swf")!=-1){if(typeof(ad_src)!='undefined'&&ad_src!=''){//有广告document.write('<divstyle="width:'+width+'px;position:relative;text-align:left;"><divstyle="position:absolute;"id="loading_div"style="width:'+width+'px;"><div><ahref="'+ad_url+'"target="_blank"><imgsrc="'+ad_src+'"border="0"></a></div><divstyle="height:10px;border:1pxsolid#000000;text-align:left;"><divstyle="height:10px;width:0;background:url(http://i3.sinaimg.cn/gm/hd/ks/swf.gif);float:left;"id="perbar_div"></div></div><divalign="center"style="clear:both;"><fontcolor="#034470">游戏正在加载<spanid="percent_div"></span>,请稍候。。。</font></div></div><divid="game_div"style="visibility:hidden;margin:0030px0;"><objectclassid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"width="'+width+'"height="'+height+'"align="middle"id="gameyesflash"><paramname="allowScriptAccess"value="always"/><paramname="wmode"value="window"/><paramname="movie"value="'+ssrc+'"/><paramname="menu"value="false"/><paramname="quality"value="high"/><paramname="bgcolor"value="#990000"/><embedsrc="'+ssrc+'"name="gameyesflash"menu="false"quality="high"bgcolor="#990000"width="'+width+'"height="'+height+'"align="middle"allowScriptAccess="always"wmode="window"type="application/x-shockwave-flash"pluginspage="http://www.macromedia.com/go/getflashplayer"/></object></div></div>');vargame_swf=getSwf('gameyesflash');vargame_div=document.getElementById('game_div');varperbar_div=document.getElementById('perbar_div');varpercent_div=document.getElementById('percent_div');varloading_div=document.getElementById('loading_div');varloadingtime=5;//至少显示5秒varstarttime=newDate();varaditv=setInterval(percent,50);}else{//无广告document.write('<divid="game_div"><objectclassid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"width="'+width+'"height="'+height+'"align="middle"id="gameyesflash"><paramname="allowScriptAccess"value="always"/><paramname="wmode"value="transparent"/><paramname="movie"value="'+ssrc+'"/><paramname="menu"value="false"/><paramname="quality"value="high"/><paramname="bgcolor"value="#990000"/><embedsrc="'+ssrc+'"name="gameyesflash"menu="false"quality="high"bgcolor="#990000"width="'+width+'"height="'+height+'"align="middle"allowScriptAccess="always"wmode="transparent"type="application/x-shockwave-flash"pluginspage="http://www.macromedia.com/go/getflashplayer"/></object></div>');}}functionpercent(){try{varper=game_swf.PercentLoaded();}catch(e){varper=100;}vartime=(newDate())-starttime;vartime_per=Math.round(time/10/loadingtime);if(per>time_per)per=time_per;perbar_div.style.width=width*per/100+'px';percent_div.innerHTML=per+'%';if(per>=100){clearInterval(aditv);loading_div.innerHTML='';loading_div.style.display="none";game_div.style.margin=0;game_div.style.visibility='visible';}}functiongetSwf(id){if(document.all){return(document.getElementById(id));}else{return(document.embeds[id]);}}上页代码是正常页,把js里面一段修改如下一段就不正常<div><ahref="'+ad_url+'"target="_blank"><imgsrc="'+ad_src+'"border="0"></a></div>修改成:<div><scripttype="text/javascript">google_ad_client="pub-6890015763382433";google_ad_width=300;google_ad_height=250;google_ad_format="300x250_as";google_ad_type="text_image";google_ad_channel="0465360793";google_color_border="ffffff";google_color_bg="ffffff";google_color_link="0000FF";google_color_text="000000";google_color_url="008000";</script><scripttype="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>请高手指教,谢谢
解决方案五:
学习
解决方案六:
自己顶一下
解决方案七:
来学习下~~
解决方案八:
学习咯!!!
解决方案九:
强大。。。路过接分
解决方案十:
学习了
解决方案十一:
真得没有人会吗?
解决方案十二:
真得没有人会吗?