首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

急一个asp的有关问题-点击收藏/显示table

2012-04-05 
急,一个asp的问题-点击收藏/显示tabletdheight 22 onClick javascript:if(jueban.style.display n

急,一个asp的问题-点击收藏/显示table
<td   height= "22 "   onClick= "javascript:if(jueban.style.display== 'none '){jueban.style.display= 'block '}else{jueban.style.display= 'none '}; ">
  <%if   len(trim(rsg( "anclass ")))> 12   then
response.write   left(trim(rsg( "anclass ")),12)& " "
else
response.write   trim(rsg( "anclass "))
end   if%>
                                </td>
   

                                <table   width= "67% "     id= "jueban "   style= "display:none   ">  
                                <%
set   rs_news=server.createobject( "adodb.recordset ")
sqltext4= "select   *   from   shop_nclass   where   anclassid= "&rsg( "anclassid ")& "   and   xs=2   order   by   nclassidorder   asc "
rs_news.open   sqltext4,conn,1,1  
%>

                                <tr>
                                <%i=0
do   while   not   rs_news.eof%>

                                <td   width= "22 "> <img   src=img/tb2.gif> </td>

                                <td> <div   align= "left ">  
<a   href= "class.asp?lx=small&anid=1&nid= <%=rs_news( "nclassid ")%> "   target= "_blank "   style= "text-decoration:   none ">  
                                                                    <%=cutstr(rs_news( "nclass "),22)%> </a> <font   size= "2 ">
                                                        </font>
                                                        </div> </td>

                                </tr>
                                <%rs_news.movenext
i=i+1
if   i=3   then   exit   do
loop
rs_news.close   %>

                                </table>


错误:jueban.style.display   为空/不是对象
代码:0



我试了好多方法,都不能打开,求助!!!!



[解决办法]
onClick= "javascript:if(jueban.style.display== 'none '){jueban.style.display= 'block '}else{jueban.style.display= 'none '}; "
-----------------------------------
把这部分写成函数试试!!
<td height= "22 " onClick= "ShowOrNot() ">

<script style= "text/javascript ">
function ShowOrNot()
{
//do it yourself!
}
</script>

要是还不行那就可能是数据库在向页面输出数据时的错误了!!
display:none 其实就相当于把这个块元素内的内容移出页面,数据库没办法输出到指定地方!
知道的不多大家多多交流了

热点排行