[导入]ASP常用函数:doAlert()

<%
'功能:输出alert信息并实现页面跳转
'来源:http://jorkin.reallydo.com/article.asp?id=470
'需要Str4Js函数:http://jorkin.reallydo.com/article.asp?id=466

Function doAlert(sInfo, sUrl)
    
sUrl = BStr(sUrl)
    
sInfo = BStr(sInfo)
    
If LCase(sUrl) = "back" Then sUrl = "javascript:history.back()"
    
If LCase(sUrl) = "close" Then sUrl = "javascript:window.close();"
    
If LCase(sUrl) = "referer" Then sUrl = Request.ServerVariables("HTTP_REFERER")
    
Response.Write( "</scr" & "ipt>" & vbCrLf & "<scr" & "ipt language=""javascript"">" & vbCrLf )
    
If sInfo<>"" Then Response.Write( "  alert('" & Str4Js(sInfo) & "');" & vbCrLf )
    
If sUrl<>"" Then
        
Response.Write( "  window.location.href='" & Str4Js(sUrl) & "';" & vbCrLf & "</scr" & "ipt>" & vbCrLf )
        
Response.End()
    
Else
        
Response.Write( "</scr" & "ipt>" & vbCrLf )
    
End If
End Function
%>


文章来源: http://Jorkin.Reallydo.Com/default.asp?id=470

你可能感兴趣的:(alert)