ASP如何在TITLE实现自动调用文章标题?
<title>标题</title><SCRIPTlanguage=JavaScript>varcurrentpos,timer;functioninitialize(){...
<title>标题</title>
<SCRIPT language=JavaScript>
var currentpos,timer;
function initialize()
{
timer=setInterval("scrollwindow()",50);
}
function sc(){
clearInterval(timer);
}
function scrollwindow()
{
currentpos=document.body.scrollTop;
window.scroll(0,++currentpos);
if (currentpos != document.body.scrollTop)
sc();
}
document.onmousedown=sc
document.ondblclick=initialize
</SCRIPT>
</head>
<body bgcolor="#C4CBDB">
<!--#include file="top.asp"-->
<%
id=cstr(request("id"))
Set rsnews=Server.CreateObject("ADODB.RecordSet")
sql="update news set hits=hits+1 where id="&id
conn.execute sql
sql="select * from news where id="&id
rsnews.Open sql,conn,1,1
title=rsnews("title")
if rsnews.eof and rsnews.bof then
response.Write("数据库出错")
else
%>
<%
BigClass=request("BigClass")
SmallClass=request("SmallClass")
'====WL======================
p=request.QueryString("p")
sContent = rsnews("content")
fyurl="?id="&id&"&BigClass="&BigClass&"&SmallClass="&SmallClass&"&"
set newpage=new wl_fy_page
'newpage.showpage sContent,p,url
'====WL======================
%>
<td width="741" class="xiaobiaoti">
<%if SmallClass<>"" then
response.Write(SmallClass)
else
response.Write(Bigclass)
end if
%>
<table width="1003" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="215" valign="top"><!--#include file="left1.asp"--></td>
<td width="788" valign="top"><table width="100%" border="0" cellspacing="20" cellpadding="0">
<tr>
<td align="left"><table Class=border width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" height="206" valign="top">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="50" colspan="2" align="center" style="font-weight:bold"><%= rsnews("title") %></td>
</tr>
<tr>
<td width="21%" height="30" class="tit" style="border-top: 1 solid #666666;border-bottom: 1 solid #666666">双击自动滚屏</td>
<td width="79%" align="right" style="border-top: 1 solid #666666;border-bottom: 1 solid #666666">发布者:<%= rsnews("user") %>
发布时间:<%= FormatDateTime(rsnews("AddDate"),2) %> 阅读:<font color="#FF0000"><%= rsnews("hits") %
删除了部分没有用代码.
我把tittle写成 <title><%= rsnews("title") %></title>
直接就出错了
Microsoft VBScript 运行时错误 '800a000d'
<p>类型不匹配: 'rsnews'
<p>\docc\shownews.asp, line 4
也不知道是怎么回事
请求高手指点 感激不尽 展开
<SCRIPT language=JavaScript>
var currentpos,timer;
function initialize()
{
timer=setInterval("scrollwindow()",50);
}
function sc(){
clearInterval(timer);
}
function scrollwindow()
{
currentpos=document.body.scrollTop;
window.scroll(0,++currentpos);
if (currentpos != document.body.scrollTop)
sc();
}
document.onmousedown=sc
document.ondblclick=initialize
</SCRIPT>
</head>
<body bgcolor="#C4CBDB">
<!--#include file="top.asp"-->
<%
id=cstr(request("id"))
Set rsnews=Server.CreateObject("ADODB.RecordSet")
sql="update news set hits=hits+1 where id="&id
conn.execute sql
sql="select * from news where id="&id
rsnews.Open sql,conn,1,1
title=rsnews("title")
if rsnews.eof and rsnews.bof then
response.Write("数据库出错")
else
%>
<%
BigClass=request("BigClass")
SmallClass=request("SmallClass")
'====WL======================
p=request.QueryString("p")
sContent = rsnews("content")
fyurl="?id="&id&"&BigClass="&BigClass&"&SmallClass="&SmallClass&"&"
set newpage=new wl_fy_page
'newpage.showpage sContent,p,url
'====WL======================
%>
<td width="741" class="xiaobiaoti">
<%if SmallClass<>"" then
response.Write(SmallClass)
else
response.Write(Bigclass)
end if
%>
<table width="1003" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="215" valign="top"><!--#include file="left1.asp"--></td>
<td width="788" valign="top"><table width="100%" border="0" cellspacing="20" cellpadding="0">
<tr>
<td align="left"><table Class=border width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" height="206" valign="top">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="50" colspan="2" align="center" style="font-weight:bold"><%= rsnews("title") %></td>
</tr>
<tr>
<td width="21%" height="30" class="tit" style="border-top: 1 solid #666666;border-bottom: 1 solid #666666">双击自动滚屏</td>
<td width="79%" align="right" style="border-top: 1 solid #666666;border-bottom: 1 solid #666666">发布者:<%= rsnews("user") %>
发布时间:<%= FormatDateTime(rsnews("AddDate"),2) %> 阅读:<font color="#FF0000"><%= rsnews("hits") %
删除了部分没有用代码.
我把tittle写成 <title><%= rsnews("title") %></title>
直接就出错了
Microsoft VBScript 运行时错误 '800a000d'
<p>类型不匹配: 'rsnews'
<p>\docc\shownews.asp, line 4
也不知道是怎么回事
请求高手指点 感激不尽 展开
1个回答
展开全部
把上面有些代码改成这样看看
<!--#include file="top.asp"-->
<%
id=cstr(request("id"))
Set rsnews=Server.CreateObject("ADODB.RecordSet")
sql="update news set hits=hits+1 where id="&id
conn.execute sql
sql="select * from news where id="&id
rsnews.Open sql,conn,1,1
title=rsnews("title")
%>
<title><%= title %></title>
<body bgcolor="#C4CBDB">
<%
if rsnews.eof and rsnews.bof then
response.Write("数据库出错")
else
%>
<!--#include file="top.asp"-->
<%
id=cstr(request("id"))
Set rsnews=Server.CreateObject("ADODB.RecordSet")
sql="update news set hits=hits+1 where id="&id
conn.execute sql
sql="select * from news where id="&id
rsnews.Open sql,conn,1,1
title=rsnews("title")
%>
<title><%= title %></title>
<body bgcolor="#C4CBDB">
<%
if rsnews.eof and rsnews.bof then
response.Write("数据库出错")
else
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询