紧急911.代码未定义找了就是改了还是错.帮忙看看
JS文件
------------------------------------------------------------------------------
var _pi=0;
var _players=new Array();
var _intervals=new Array();
var _playIndexs=new Array();
var _playItems=new Array();
var _attFuncs=new Array();
function installImgPlayer(el)
{
if(!el) return;
var img;
var n=0;
var imgs=new Array();
var i;
for(i=0;i<el.childNodes.length;i++)
{
img=el.childNodes;
if(img && img.tagName && img.tagName.toUpperCase()=="IMG")
{
imgs.push(img);
}
}
if(imgs.length>0)
{
if(!el.id || el.id=="") el.id="imgplayer_"+_pi;
_pi++;
_players[el.id]=el;
_playIndexs[el.id]=-1;
_playItems[el.id]=imgs;
imgs[0].style.zIndex=100;
if(arguments.length>1)
{
var ctrl=arguments[1];
var s="";
for(i=0;i<imgs.length;i++)
{
s+="<a href=\"javascript:ImgPlay('"+el.id+"',"+i+")\" id=\""+el.id+"_ctrl_"+i+"\">"+(i+1).toString()+"</a>";
}
ctrl.innerHTML+=s;
}
if(arguments.length>2)
{
var func=arguments[2];
_attFuncs[el.id]=func;
}
}
}
function ImgPlay(elid)
{
var n;
var el=document.getElementById("elid");
if(arguments.length>1) n=parseInt(arguments[1]);
else n=parseInt(_playIndexs[elid])+1;
var imgs=_playItems[elid];
if(typeof(imgs)!="object")return;
if(n >=imgs.length) n=0;
var ctrl,func;
for(var i=0;i<imgs.length;i++)
{
ctrl=document.getElementById(elid+"_ctrl_"+i);
func=_attFuncs[elid];
if(i==n)
{
imgs.style.zIndex=100;
if(ctrl) ctrl.className="imgplayer_l";
if(imgs.filters)
{
imgs.filters.revealTrans.Transition=6;
imgs.filters.revealTrans.apply();
imgs.filters.revealTrans.play();
}
if(func)
{
eval(func+"('"+elid+"',"+i+")");
}
}
else
{
imgs.style.zIndex=90;
if(ctrl) ctrl.className="";
}
}
_playIndexs[elid]=n;
}
function ImageStartPlay(el,s)
{
if(!el) return;
var n=0;
if(arguments.length>2) n=parseInt(arguments[2]);
if(_intervals[el.id]!=null)
window.clearInterval(_intervals[el.id]);
ImgPlay(el.id,0);
_intervals[el.id]=window.setInterval("ImgPlay('"+el.id+"')",s);
}
------------------------------------------------------------------------------------------
在asp页面调用的代码
------------------------------------------------------------------------------------------
<DIV class=ImagePlayer id=topplayer style="WIDTH: 287px; HEIGHT: 143px">
<% set ss=server.CreateObject("adodb.recordset")
sql1="select * from guanggao where gg_id=0 order by u9_id asc"
ss.open sql1,conn,1,1
i=1
do while not ss.eof
%>
<IMG src="ImgPlay/<%=ss("images_gg")%>" alt=<%=ss("shuoming")%> width=287 height=136 border="0" onclick=getFilm(s)>
<%i=i+1
ss.movenext
loop
ss.close
set ss=nothing
%>
</DIV>
<SCRIPT src="imageplayer.js" type=text/javascript></SCRIPT>
<SCRIPT type=text/javascript><!--
var topplayer=document.getElementById("topplayer");
var topplayer_ctrl=document.getElementById("topplayer_ctrl");
installImgPlayer(topplayer,topplayer_ctrl);
window.onload=function(){ImageStartPlay(topplayer,3000)};
--></SCRIPT>
--------------------------------------------------------------------------------------------------------------
问题出在"s"未定义
但是里面确实定义好了啊
本人认为s+="<a href=\"javascript:ImgPlay('"+el.id+"',"+i+")\" id=\""+el.id+"_ctrl_"+i+"\">"+(i+1).toString()+"</a>";
这句有问题在onclick=getFilm(s)调用不了,也就连接不了地址
郁闷很久了解决不了
求助大虾看看解决下.............感激不尽啊