ASP常用函数收藏乱七八糟未整理版(2)
Sub Go(url)
Response.Write ("<script>location.href('" & url & "')</script>")
End Sub
'*******************************************************************
' 我比较喜欢将以上三个结合起来使用
'*******************************************************************
Function Alert(message, gourl)
message = Replace(message, "'", "\'")
If gourl = "-1" Then
Response.Write ("<script language=javascript>alert('" & message & "');history.go(-1)</script>")
Else
Response.Write ("<script language=javascript>alert('" & message & "');location='" & gourl &"'</script>")
End If
Response.End()
End Function
'*******************************************************************
' 指定秒数重定向另外的连接
'*******************************************************************
Sub GoPage(url, s)
s = s * 1000
Response.Write "<SCRIPT LANGUAGE=JavaScript>"
Response.Write "window.setTimeout("&Chr(34)&"window.navigate('"&url&"')"&Chr(34)&","&s&")"
Response.Write "</script>"
End Sub
'*******************************************************************
' 判断数字是否整形
'*******************************************************************
Function isInteger(para)
On Error Resume Next
Dim Str
Dim l, i
If IsNull(para) Then
isInteger = False
Exit Function
End If
Str = CStr(para)
If Trim(Str) = "" Then
isInteger = False
Exit Function
End If
l = Len(Str)
For i = 1 To l
If Mid(Str, i, 1)>"9" or Mid(Str, i, 1)<"0" Then
isInteger = False
Exit Function
内容版权声明:除非注明,否则皆为本站原创文章。