日期:2014-05-17  浏览次数:21049 次

ASP与JS结合图片轮显
1,请问这些代码有没有问题?
2,请问调试的时候为什么会出现缺少分号的报错信息啊?
代码如下:

<!--#include   file= "conn.asp "-->
<%   set   rs=server.createobject( "adodb.recordset ")  
sql= "select     all   top   4   *   from   AD   order   by   id   asc "  
rs.open   sql,conn,1,1  
if   rs.eof   and   rs.bof   then
response.Write( "暂无照片 ")  
else
%>  
<body>
<script   language= "javascript ">
<%   dim   x  
for   x=0   to   3  
%>  
pic[ <%=x%> ]   = <%=rs( "pic ")%>  
url[ <%=x%> ]   = <%=rs( "url ")%>  
text[ <%=x%> ]= <%=rs( "text ")%>  
<%  
rs.MoveNext
next
end   if  
%>
var   focus_width=180
  var   focus_height=160
  var   text_height=15
  var   swf_height   =   focus_height+text_height
 
var   pics=pic[0]+ "| "+pic[1]+ "| "+pic[2]+ "| "+pic[3]//图片地址  
var   links=url[0]+ "| "+url[1]+ "| "+url[2]+ "| "+url[3]//鼠标点击后转向地址  
var   texts=text[0]+ "| "+text[1]+ "| "+text[2]+ "| "+text[3];//标题
 
  document.write( ' <object   classid= "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 "   codebase= "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0 "   width= " '+   focus_width   + ' "   height= " '+   swf_height   + ' "> ');
  document.write( ' <param   name= "allowScriptAccess "   value= "sameDomain "> <param   name= "movie "   value= "flash/wc_jiaodian.swf "> <param   name=wmode   value=transparent> <param   name= "quality "   value= "high "> ');
  document.write( ' <param   name= "menu "   value= "false "> <param   name=wmode   value= "opaque "> ');
  document.write( ' <param   name= "FlashVars "   value= "pics= '+pics+ '&links= '+links+ '&texts= '+texts+ '&borderwidth= '+focus_width+ '&borderheight= '+focus_height+ '&textheight= '+text_height+ ' "> ');
  document.write( ' <embed   src= "flash/playswf.swf "   wmode= "opaque "   FlashVars= "pics= '+pics+ '&links= '+links+ '&texts= '+texts+ '&borderwidth= '+focus_width+ '&borderheight= '+focus_height+ '&textheight= '+text_height+ ' "   menu= "false "   bgcolor= "#DADADA "   quality= "high "   width= " '+   focus_width   + ' "   height= " '+   swf_height   + ' "   allowScriptAccess= "sameDomain "   type= "application/x-shockwave-flash "   pluginspage= "http://www.macromedia.com/go/getflashplayer "   /> ');     document.write( ' </object> ');
 

  </script>
</body>
</html>


在网页查看源文件中,是这样的: