ASP 信息提示函数并作返回或者转向(函数的返回地址是什么)这样也行?

随心笔谈2年前发布 admin
202 0 0

文章摘要

这篇文章描述了一个名为“信息提示窗口”的子程序,用于向用户显示提示信息并根据指定的处理类型进行返回、转向或关闭。该程序接受三个参数:提示字符串、处理类型和转向方向。根据处理类型,程序分别通过`history.go(-1)`返回、`window.location`转向目标地址,或`window.close()`关闭窗口。代码中使用了`select case`结构来实现不同的功能分支。


‘************************
‘子程序名:信息提示窗口
‘功能:信息提示,并作返回或者转向
‘参数:
‘str 提示字符串
‘stype 处理类型:Back 返回 GoUrl 转向 Close 关闭
‘url 转向方向
‘************************
Sub MsgBox(str,stype,url)
response.write “<script language=javascript>”
response.write “alert(‘”&str&”‘);”
select case stype
case “Back”
response.write “history.go(-1);”
case “GoUrl”
response.write “window.location='”&url&”‘”
case “Close”
response.write “window.close()”
end select
response.write “</script>”
End Sub

© 版权声明

相关文章