<%
Function conleft(content,strlen)
t=0
For i=1 to len(content)
c=Abs(Asc(Mid(content,i,1)))
If c>255 Then
t=t+2
Else
t=t+1
End If
If t>strlen Then
conleft=left(content,i) & "…"
exit for
Else
conleft=content
End If
Next
End Function
%>
把以上语句插入到页面最顶
之后在
<%=(Rsnews.Fields.Item("news_title").Value)%> 改为<%=conleft(Rsnews.Fields.Item("news_title").Value,300)%>
其中300可以改为任意参数