Asp教程

通过asp实例结合结合ACCESS,MSSQL来更好的深入Asp学习 - 爬坡者

« [转] 海量数据库的查询优化及分页算法方案 3 - 实现小量和海量的通用分页显示存储过程SQL语句大全,SQL命令大全,SQL技巧大全 »

html中用js调用ASP文件 实现静态页面动态显示-客户评论

html中用js调用ASP文件,实现静态页面动态显示,比如HMTL文章的动态新闻评论等

---简单版[调用代码,把他放哪儿,就在哪儿显示]--------

<script language="javascript" src="asdf.asp"></script>

-----asdf.asp文件----------
<%
Response.Write "document.write(""hello"");" '根据自己需要处理相关东西!
%>

-------------------------------------------------------------------------------


---复杂版[调用代码,把他放哪儿,就在哪儿显示]--------

<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&""");"
%>

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

最新评论及回复

最近发表

Powered By Z-Blog 1.8 Spirit Build 80710

Copyright 2007-2008 papozhe.com [asp教程] All Rights Reserved.
浙ICP备07030537号
免责申明:所有文章除特别声明,均来自网上,主要为学习用!内容仅供参考,版权归原作者。如侵犯您利益,请来信告知.
Email:papozhe$Gmail.com QQ:76336503