html中用js调用ASP文件
分类:电脑知识 发表于:2009-03-13 11:11:54 评论(0)
html中用js调用ASP文件,实现静态页面动态显示
----------html中调用代码:----------
<script language="javascript" src="sample.asp"></script>
----------sample.asp文件简单代码:----------
<%
Response.Write "document.write(""hello"");"
%>
----------sample.asp文件复杂代码:----------
<!--#include file="conn.asp"-->
<%
Set rs = Server.CreateObject("ADODB.Recordset")
strSQL="SELECT top 1 * FROM biao order by id desc"
rs.Open strSQL,conn,1,1
Response.Write "document.write("" <table width=100% border=0><tr bgcolor=#ECE9D8> "");"
Response.Write "document.write("" <td width=100>" & Rs("ziduan") & "</td> "");"
Response.Write "document.write("" </tr><tr height=3></tr></table> "");"
rs.Close
set rs=nothing
%>