ASP常用函数收藏乱七八糟未整理版(37)
' 弹出对话框
'*******************************************************************
Sub alert(message)
message = Replace(message, "'", "\'")
Response.Write ("<script>alert('" & message & "')</script>")
End Sub
'*******************************************************************
' 返回上一页,一般用在判断信息提交是否完全之后
'*******************************************************************
Sub GoBack()
Response.Write ("<script>history.go(-1)</script>")
End Sub
'*******************************************************************
' 重定向另外的连接
'*******************************************************************
Sub Go(url)
Response.Write ("<script>location.href('" & url & "')</script>")
End Sub
'*******************************************************************
' 把html标记替换
'*******************************************************************
Function htmlencode2(Str)
Dim result
Dim l
If IsNull(Str) Then
htmlencode2 = ""
Exit Function
End If
l = Len(Str)
result = ""
Dim i
For i = 1 To l
Select Case Mid(Str, i, 1)
Case "<"
result = result + "<"
Case ">"
result = result + ">"
Case Chr(13)
result = result + "<br>"
Case Chr(34)
result = result + """%>
<%
cLeft(String, Length) 返回指定数目的从字符串的左边算起的字符,区分单双字节。
如:
Dim MyString, LeftString
内容版权声明:除非注明,否则皆为本站原创文章。