4,ASP中應(yīng)用
以上是在客戶端腳本調(diào)試,和ASP也是大同小異:最主要的是函數(shù)功能。
<% text=rs("content") '將數(shù)據(jù)庫字段值賦到某變量上 i=10 '定義固定大小 if len(text)>i then '如果文本長度大于給定的值 text=left(text,i) '則提取前段的i位的字符串 response.write (text&"...") else response.write (text) end if %> |
5,為了方便,做成函數(shù)
<% function conleft(content,i) if len(content)>i then content=left(content,i) response.write (content&"...") else response.write (content) end if end function %> |
以上為函數(shù),下面就可以直接調(diào)用。
<%call conleft(rs("content"),10)%> |
OK,相信以后遇到這些問題應(yīng)該是NO PROBLEM
新聞熱點(diǎn)
疑難解答
圖片精選