风格选择:黄绿 | 天蓝 | 红灰
导航
SEO首页>>网站建设>>程序开发>>html中js调用asp
html中js调用asp

这阵子我一直在网上查怎样才能在html中实现动态数值的显示,现在我就向大家介绍下这几天的结果。

首先是在静态页中调用asp页

<script language="javascript" src="ex_logo.asp?lai=1"></script>

lai是显示的类型,接着就是ex_logo.asp文件

<!--#include file="../inc/连接数据库.asp"-->
<%
Response.Buffer = True
Response.Expires = -1
Response.CharSet = "gb2312"
Session.CodePage = "936"
%>
<%
lai=request("lai")
if request("lai")="1" then
sql="select  top 9 * from 记录集 where xs='yes'and lai='1'order by ex_id desc"
set rs=conn.execute(sql)
do while not rs.eof
dim pic,url,content
pic=rs("ex_pic")
url=rs("ex_url")
content=rs("ex_content")
Response.Write "document.write(""&nbsp;<a title="&content&" href="&url&">"");"
Response.Write "document.write(""<img src='"&pic&"'/height=31 width=88 border=0>"");"
Response.Write "document.write(""</a>"");"
rs.movenext
loop
elseif request("lai")="0" then
sql="select  top 9 * from 记录集 where xs='yes'and lai='0'order by ex_id desc"
set exrs=conn.execute(sql)
do while not exrs.eof
dim expicname,exurl,excontent
exurl=exrs("ex_url")
excontent=exrs("ex_content")
expicname=exrs("ex_picname")
Response.Write "document.write(""&nbsp;<a title="&excontent&" href="&exurl&">"");"
Response.Write "document.write('"&expicname&"');"
Response.Write "document.write(""</a>"");"
exrs.movenext
loop
end if
%>

希望对大家有所帮助!

EX-SEO原创,转载请注明,谢谢!

内容来源:EX工作室-SEO资料站
浏览次数:0
ex 发布于 2007-11-20
评论内容
1、  dsfsdf
[B]sdffds[/B]
游客 评论于 2008-2-1
2、  hhhhhhhhhhhhhfsdg
[center][I]dfsgdsfg[/I]
   fdgssdfgdfsg[/center]
游客 评论于 2008-2-1
3、  d
http://www.jfffff.com[URL=http://www.jfffff.com]http://www.jfffff.com[/URL]
游客 评论于 2008-5-5
签写评论
你的姓名:
评论主题:
支持UBB: 粗体 斜体 下划线 居中 超级连接 Email连接 插入图片 关闭上传图片 Flash图片 realplay视频文件 Media Player视频文件 飞行字 移动字 发光字
评论内容:
验 证 码:   看不清楚请点击换图
 
会员登陆
用户名  
密    码  
验证码      5200
登陆  |  注册会员
验证码无法显示,请下载修复!

广告推荐
CopyRight © 2007 一厢工作室旗下网站→EX工作室SEO资料站
版权所有 多放合作    E-mail:czx1372@163.com    交流群:23115093 粤ICP备06022088号