当前位置:编程学习 > C#/ASP.NET >>

js在aspx中总是出现错误


var elady_step=3; //1:small, 3:middle, 5:big
var elady_speed=50; //20:fast, 50:middle, 80:slow
var e_tp=new Array();
var e_tplink=new Array();
var adNum_elady1=0;  
var elady_stop_sh=0;
var elady_star_sh=1;

function elady1_moveImg(){
if ((!document.all&&!document.getElementById)||(elady_stop_sh==0)) return;
if (elady_star_sh==1){
document.all.elady1_divimg.style.pixelTop=parseInt(document.all.elady1_divimg.style.pixelTop)+elady_step;}
else if (elady_star_sh==2){
document.all.elady1_divimg.style.pixelLeft=parseInt(document.all.elady1_divimg.style.pixelLeft)+elady_step;}
else if (elady_star_sh==3){
document.all.elady1_divimg.style.pixelTop=parseInt(document.all.elady1_divimg.style.pixelTop)-elady_step;}
else{
document.all.elady1_divimg.style.pixelLeft=parseInt(document.all.elady1_divimg.style.pixelLeft)-elady_step;}
if (elady_star_sh<4) elady_star_sh++;
else elady_star_sh=1;
setTimeout("elady1_moveImg()",elady_speed);}
e_tp[0]="images/y01.gif";
e_tp[1]="images/y02.gif";
e_tp[2]="images/y03.gif";
e_tp[3]="images/y04.gif";
e_tp[4]="images/y05.gif";
e_tp[5]="images/y06.gif";
e_tp[6]="images/y07.gif";
e_tp[7]="images/y08.gif";
e_tp[8]="images/y09.gif";
e_tp[9]="images/y10.gif";
var currentimage=new Array();   
for (i=0;i<=3;i++){currentimage[i]=new Image();
      currentimage[i].src=e_tp[i];
         }
         function elady1_set(){   if (document.all)
         {      e_tprotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
               e_tprotator.filters.revealTrans.apply();   }
               }
               function elady1_playCo()
               {   if (document.all)      e_tprotator.filters.revealTrans.play()
               }function elady1_nextAd(){   if(adNum_elady1<e_tp.length-1)adNum_elady1++ ;
                     else adNum_elady1=0;
                        elady1_set();
                           document.images.e_tprotator.src=e_tp[adNum_elady1];
                              elady1_playCo();
                                 theTimer=setTimeout("elady1_nextAd()", 4000);}
                                 function elady1_linkurl(){   jumpUrl=e_tplink[adNum_elady1];
                                    jumpTarget='_blank';
                                       if (jumpUrl != ''){      if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
                                             else location.href=jumpUrl;
                                                }}
function elady1_listMsg() 
{   status=e_tplink[adNum_elady1];
document.returnValue = true;}
document.write("<div id='elady1_divimg' style='position:relative'>");
document.write('<a onMouseOver="elady1_listMsg();return document.returnValue" href="javascript:elady1_linkurl()" target="_self">');
document.write('<img style="FILTER: revealTrans(duration=2,transition=20)" height=140 src="javascript:elady1_nextAd()" width=120 border=0 name=e_tprotator ></a>');
document.write("</div>");

代码如上,在html可以执行,但是在aspx中总是说e_tprotator为定义,高手该怎么改 --------------------编程问答-------------------- up --------------------编程问答-------------------- mm --------------------编程问答-------------------- up again --------------------编程问答-------------------- 看了半天我确实没有找到你e_tprotator的定义在哪里
看得完全一头雾水 --------------------编程问答-------------------- 呵呵呵,我的js不好,那要这么该啊 --------------------编程问答-------------------- 太多代码了,晕. --------------------编程问答--------------------  呵呵,代码太多 --------------------编程问答-------------------- 用alert来调试,你的代码确实太多了,乱~~~ --------------------编程问答-------------------- var e_tprotator=你定义的对象 --------------------编程问答-------------------- 如果是引用的另外的js文件中的变量,在<head>部分作如下引用:
 <script language="javascript" src="JS文件路径" type="text/javascript"></script> 
补充:.NET技术 ,  ASP.NET
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,