
html中用js調(diào)用ASP文件,實現(xiàn)靜態(tài)頁面動態(tài)顯示,比如HMTL文章的動態(tài)新聞評論等
---簡單版[調(diào)用代碼,把他放哪兒,就在哪兒顯示]--------
<script language="javascript" src="asdf.asp"></script>
-----asdf.asp文件----------
<%
Response.Write "document.write(""hello"");" '根據(jù)自己需要處理相關(guān)東西!
%>
-------------------------------------------------------------------------------
---復(fù)雜版[調(diào)用代碼,把他放哪兒,就在哪兒顯示]--------
<script language="javascript" src="asdf.asp?cname=spell"></script>
-----asdf.asp文件----------
<!--#include file="conn.asp"-->
<%
cname=request.QueryString("cname")
turl=request.ServerVariables("URL")
sql="select gongsi from company where cname='"+cname+"'"
rs.open sql,connstr,1,1
do while not rs.eof
Response.Write "document.write("" <table width=100% border=0><tr bgcolor=#ECE9D8> "");"
Response.Write "document.write("" <td width=100>" & Rs("gongsi") & "</td> "");"
Response.Write "document.write("" </tr><tr height=3></tr></table> "");"
'Response.Write(gsname)
rs.movenext
loop
Response.Write "document.write("""&turl&""");"
%>
--------------------------------------