wqy0523 2008-2-1 13:51
求助,高手请解释一下代码
<SCR[wiki]IP[/wiki]T>
document.all.Layer2.style.display="none";
document.all.Layer3.style.display="none";
document.all.Layer4.style.display="none";
document.all.Layer2.style.visibility="hidden";
document.all.Layer3.style.visibility="hidden";
document.all.Layer4.style.visibility="hidden";
function showtb(tbobj) {
document.all.Layer1.style.display="none";
document.all.Layer2.style.display="none";
document.all.Layer3.style.display="none";
document.all.Layer4.style.display="none";
tbobj.style.display="";
tbobj.style.visibility="visible";
}
</SCRIPT> 网页提示说:已完毕,但网页上有错误:
document.all.layer2.style为空或不是对象 请解释一下是什么意思,我该怎么解决这个问题.
cnsz 2008-2-1 14:02
代码都不全怎么帮你看?
ps:怎么把技术问题发到策划社区了
wqy0523 2008-2-1 14:10
是我发错地方了
看了半天,觉得只能发到这个地方了,不经常上论坛,最近才开始接受这些的.
<!--#include file="function.asp"-->
<table width="610" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td height="49" valign="top" background="Images/recommend.gif"><table width="87%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="40%" height="39"></td>
<td width="60%" valign="middle"><script language="JavaScript" type="text/javascript">marquee3();</script>
<%
set rs9=server.CreateObject("ADODB.RecordSet")
rs9.Source="select top 6 * from "& db_EC_News_Table &" where checkked=1 order by newsid desc"
rs9.Open rs9.Source,conn,1,1
do while not rs9.EOF
title=trim(rs9("title"))
newsurl="E_ReadNews.asp?NewsID=" & rs9("NewsID")
newswwwurl=rs9("titleface")
%>
<a class="middle" target="_blank" href="<%if rs9("titleface")="无" then %><%=newsurl%><% else %> <%=newswwwurl%><%end if%>" title="<%=htmlencode4(title)%>"> <img src="images/dd.gif" width="5" height="5" border="0"> <font color="<%=rs9("titlecolor")%>"><%=CutStr(htmlencode4(rs9("title")),28)%></font>
<%rs9.movenext
loop
rs9.close
set rs9=nothing%>
</a></td>
</tr>
</table></td>
</tr>
<tr>
<td>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="226" height="217" rowspan="3" valign="middle"><table width="226" height="217" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="Images/pic_bg.gif"><div align="center">
<script type="text/javascript">
<%
set rs3=server.CreateObject("ADODB.RecordSet")
rs3.Source="select top 5 * from "& db_EC_News_Table &" where picnews=1 and goodnews=1 and checkked=1 and picname is not null order by NewsID DESC"
rs3.Open rs3.Source,conn,1,1
for i=1 to rs3.RecordCount
response.Write "imgUrl"&i&"=""uploadfile/"&rs3("picname")&""";"&vbCrLf
response.Write "imgtext"&i&"="""&CutStr(htmlencode4(rs3("title")),30)&""""&vbCrLf
response.Write "imgLink"&i&"=escape(""E_ReadNews.asp?newsid="&rs3("Newsid")&""");"&vbCrLf
rs3.movenext
if i=5 then exit for ''那里的代码只定义了5个循环所以[wiki]数据库[/wiki]里的只取5条就可以了
next
%>
var focus_width=206
var focus_height=176
var text_height=18
var swf_height = focus_height+text_height
var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3+"|"+imgUrl4+"|"+imgUrl5
var links=imgLink1+"|"+imgLink2+"|"+imgLink3+"|"+imgLink4+"|"+imgLink5
var texts=imgtext1+"|"+imgtext2+"|"+imgtext3+"|"+imgtext4+"|"+imgtext5
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="images/focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
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="images/focus.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#F0F0F0" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); document.write('</object>');
</script>
</div></td>
</tr>
</table></td>
<td width="374" height="200" align="left" valign="top"><center>
<table width="98%" border="0" cellspacing="2" cellpadding="0">
<% set rs99=server.CreateObject("ADODB.RecordSet")
rs99.Source="select top 1 * from "& db_EC_News_Table &" where daodu=1 and checkked=1 order by newsid desc"
rs99.Open rs99.Source,conn,1,1
title=trim(rs99("title"))%>
<tr>
<td height="40" colspan="2" align="center" bgcolor="#FFF4D9"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#F0F0F0">
<tr>
<td width="6%" height="36" bgcolor="#FFFFFF"><img src="Images/toutiao.gif" width="19" height="40" /></td>
<td width="94%" bgcolor="#FFFFFF"><a class="daodu" target="_blank" href="E_ReadNews.asp?NewsId=<%=rs99("newsid")%>" title="<%=CutStr(nohtml(rs99("title")),100)%>"><%=CutStr(htmlencode4(title),24)%> </a></td>
</tr>
</table></td>
</tr>
<%
rs99.close
set rs99=nothing
%>
<% set rs9=server.CreateObject("ADODB.RecordSet")
rs9.Source="select top 7 * from "& db_EC_News_Table &" where goodnews=1 and checkked=1 order by newsid desc"
rs9.Open rs9.Source,conn,1,1
if rs9.EOF then
Response.Write "<tr><td align=center>目前暂无推荐内容</td></tr>"
end if
do while not rs9.EOF
if showyear=1 then
datetime="<font class=newsdate>(" & year(rs9("UpdateTime")) &"-"& Month(rs9("UpdateTime")) &"-"& Day(rs9("UpdateTime")) &")</font>"
else
datetime="<font class=newsdate>(" & year(rs9("UpdateTime")) &"-"& Month(rs9("UpdateTime")) &"-"& Day(rs9("UpdateTime")) &")</font>"
end if
title=trim(rs9("title"))%>
<tr>
<td height="20"> <img src="Images/dd.gif" width="4" height="4"> <a class="tj" target="_blank" href="E_ReadNews.asp?NewsId=<%=rs9("newsid")%>" title="<%=CutStr(nohtml(rs9("Content")),100)%>"> <%=CutStr(htmlencode4(title),38)%></a></td>
<td align="right"><%=datetime%></td>
</tr>
<tr>
<td height="1" colspan="2" background="IMAGES/bg_line.gif"></td>
</tr>
<%rs9.movenext
loop
rs9.close
set rs9=nothing%>
</table>
</center></td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<table width="610" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="5" colspan="2"><div align="center">
<script language="JavaScript" src="./zongg/ad.asp?i=12" type="text/javascript"></script>
</div></td>
</tr>
<tr>
<td height="5" colspan="2"></td>
</tr>
</table>
<SCRIPT>
document.all.Layer2.style.display="none";
document.all.Layer3.style.display="none";
document.all.Layer4.style.display="none";
document.all.Layer2.style.visibility="hidden";
document.all.Layer3.style.visibility="hidden";
document.all.Layer4.style.visibility="hidden";
function showtb(tbobj) {
document.all.Layer1.style.display="none";
document.all.Layer2.style.display="none";
document.all.Layer3.style.display="none";
document.all.Layer4.style.display="none";
tbobj.style.display="";
tbobj.style.visibility="visible";
}
</SCRIPT>
<map name="Map" id="Map">
<area onmouseover=javascript:showtb(Layer1); shape="rect" coords="8,14,72,43">
<area onmouseover=javascript:showtb(Layer2); shape="rect" coords="96,14,160,43">
<area onmouseover=javascript:showtb(Layer3); shape="rect" coords="182,15,250,44">
<area onmouseover=javascript:showtb(Layer4); shape="rect" coords="273,14,341,42">
</map>