JS调用ASP问题

yh235 2007-06-22 09:16:07
为什么我调用的ASP显示空白?
在ASP里显示正确
但是在 html里用JS调用的话就会显示空白
查看源代码 只有。。。<script language="javascript" src="/yh.asp"></script>
这是怎么回事?


ASP页面显示的情况如下:
document.write('省市领导考察我公司中华标准件网 2007-4-16
document.write('通用网址在线注册服务条款 2006-6-23
document.write('通用网址争议解决办法 2006-6-23
document.write('通用网址注册办法 2006-6-23
document.write('通用网址 2006-6-23
document.write('关于通用网址 2006-6-23
document.write('精创网络--邯郸、邢台通用网址注册机构 2006-6-21
...全文
171 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaojun8114 2007-06-22
  • 打赏
  • 举报
回复
lz是不是少写了后面的")啊
hookee 2007-06-22
  • 打赏
  • 举报
回复
<!--#include file="conn.asp"-->
<%
Response.ContentType="text/javascript"
Set rs = Server.CreateObject("ADODB.Recordset")
sqll9 = "select id,title,img,biaoshi,riqi from news where lei=1 order by riqi desc"
rs.open sqll9,conn,1,1
if rs.eof then

response.write "alert('暂无新闻!');location.href='index.asp'"
else
rs.pagesize=7
page=CInt(request.querystring("tp"))
if page<1 then page=1
if page>rs.pagecount then page=rs.pagecount
rs.Absolutepage=page
for i = 1 to rs.pagesize
id=rs("id")
title=rs("title")
riqi=rs("riqi")
if len(title)>20 then
title=mid(title,1,15) & "..."
end if

%>
<%
response.Write "document.write('<table width=442 border=0 cellpadding=0 cellspacing=0><tr><td width=346 height=20><A class=glow5 href=shownews1.asp?id=" & id & " target=_blank>"& replace(title,"'","\'") &"</A></td><td width=96 valign=top>"& left(riqi,9) & "</td> </tr></table>');"
%>

<%
rs.movenext
if rs.eof then exit for
next
end if
rs.close
set rs = nothing
conn.close
set conn = nothing
%>
php_wsd 2007-06-22
  • 打赏
  • 举报
回复
<%
response.Write("document.write('<table width=442 border=0 cellpadding=0 cellspacing=0><tr><td width=346 height=20><A class=glow5 href=shownews1.asp?id="&id&" target=_blank>"&title&"</A></td><td width=96 valign=top>"&left(riqi,9)&"</td> </tr></table>')")
%>
试试
yh235 2007-06-22
  • 打赏
  • 举报
回复
HOHO~ 3q~ devms 结贴~
  • 打赏
  • 举报
回复
response.Write("document.write('<table width=442 border=0 cellpadding=0 cellspacing=0><tr><td width=346 height=20><A class=glow5 href=shownews1.asp?id="&id&" target=_blank>"&title&"</A></td><td width=96 valign=top>"&left(riqi,9)&"</td> </tr></table>")

->

response.Write("document.write('<table width=442 border=0 cellpadding=0 cellspacing=0><tr><td width=346 height=20><A class=glow5 href=shownews1.asp?id="&id&" target=_blank>"&title&"</A></td><td width=96 valign=top>"&left(riqi,9)&"</td> </tr></table>');")
yh235 2007-06-22
  • 打赏
  • 举报
回复
<!--#include file="conn.asp"-->
<%
Set rs = Server.CreateObject("ADODB.Recordset")
sqll9 = "select id,title,img,biaoshi,riqi from news where lei=1 order by riqi desc"
rs.open sqll9,conn,1,1
if rs.eof then

response.write "<script>alert('暂无新闻!');location.href='index.asp'</script>"
else
rs.pagesize=7
page=CInt(request.querystring("tp"))
if page<1 then page=1
if page>rs.pagecount then page=rs.pagecount
rs.Absolutepage=page
for i = 1 to rs.pagesize
id=rs("id")
title=rs("title")
riqi=rs("riqi")
if len(title)>20 then
title=mid(title,1,15) & "..."
end if

%>



<%
response.Write("document.write('<table width=442 border=0 cellpadding=0 cellspacing=0><tr><td width=346 height=20><A class=glow5 href=shownews1.asp?id="&id&" target=_blank>"&title&"</A></td><td width=96 valign=top>"&left(riqi,9)&"</td> </tr></table>")
%>

<%
rs.movenext
if rs.eof then exit for
next
end if
%>

=================================
这是ASP代码 麻烦帮忙看看哪错了
hookee 2007-06-22
  • 打赏
  • 举报
回复
直接访问ASP,返回的代码似乎不完整,应该是
document.write('省市领导考察我公司中华标准件网 2007-4-16');
...
另外,输出前要设定Response.ContentType="text/javascript"
  • 打赏
  • 举报
回复
document.write('省市领导考察我公司中华标准件网 2007-4-16

你觉得这是什么代码,有可能执行么
yh235 2007-06-22
  • 打赏
  • 举报
回复
<script language="javascript" src="/yh.asp"></script>
错了 上面没有那个/
但是有没有/效果都一样

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧