试用过下面的调用方式,完全没有作用
<script language="javascript" src="js.asp" ></script>
版主说的方法,听起来是明白的,但做法不明寮
我想在HTM的某个表格中 调用 JS.ASP 也就是下面的代码。
-----------------------------------------------------------------------------------------------------------
<%
dim conn
dim connstr
dim db
db="数据库目录/数据库.asa" '数据库文件的位置
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
conn.Open connstr
sub CloseConn()
conn.close
set conn=nothing
end sub
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><%set rsbig=server.createobject("adodb.recordset")
rsbig.open "select category,categoryid,icon from category where parentid=0 and hide=0 order by categoryorder asc",conn,1,1
if rsbig.eof and rsbig.bof then
rsbig.close
response.write"<td><font color='#ff0000'>暂无统计数据!</font></td>"
else
n=0
do while not rsbig.eof %>
<td width="70" align="center"><img src="<%=rsbig("icon")%>" onload ="javascript:if(this.width>65)this.width=65;if(this.height>65)this.height=65;"></td>
<td valign="top"><table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="25"><a href="product.asp?bigclassid=<%=rsbig("categoryid")%>"><b><%=rsbig("category")%></b></a></td>
</tr>
<tr>
<td><%set rssm=server.createobject("adodb.recordset")
rssm.open "select category,categoryid,icon from category where parentid="&rsbig("categoryid")&" and hide=0 order by categoryorder asc",conn,1,1
if rssm.eof and rssm.bof then
rssm.close
response.write"<font color='#ff0000'>暂无分类数据!</font>"
else
y=1
do while not rssm.eof %>
<a href='product.asp?bigclassid=<%=rsbig("categoryid")%>&smallclassid=<%=rssm("categoryid")%>'><%=rssm("category")%></a> <% if rssm.RecordCount<>int(y) then response.write " | " end if%>
<% y=y+1
rssm.movenext
loop
end if
%></td>
</tr>
<tr>
<td> </td>
</tr>
</table></td><% n=n+1
if n mod 2=0 and n<>rsbig.RecordCount then
response.write"</tr><tr><td height='3' colspan='4' background='images/LINE.JPG'><img name='' src='' width='1' height='3' alt=''></td></tr><tr>"
end if
rsbig.movenext
loop
end if
rssm.close
set rssm=nothing
rsbig.close
set rsbig=nothing%>
</tr>
</table>
问题完满解决了,使用 桢 载入
使用以下函数可以 去除 桢 默认的样式,并能自动缩放,感觉就是爽
<script>
function autoResize()
{
try
{
document.all["content"].style.height=content.document.body.scrollHeight
}
catch(e){}
}
</script>
---------------------------------------- 调用如下 ----------------------------------
<iframe src="topmenu.asp" name="content" id="content" scrolling="no" frameborder="0" width="100%" onload="autoResize();"></iframe>