JAVA MSG自定义函数调用方法:

来源:互联网 发布:网络与新媒体专业课程 编辑:程序博客网 时间:2024/05/16 19:49

JAVA MSG自定义函数调用方法:

<%
 //输出JavaScript提示信息

Sub JavaMsg(strMsg, intType)
 Response.Write("<script>alert("""& strMsg &""");")
 Select Case intType
  Case 1 : Response.Write("history.go(-1);</script>")
  Case 2 : Response.Write("window.close();</script>")
 End Select
 If Left(intType, 7) ="http://" Then Response.Write("location.href='"& intType &"';")
 Response.Write("</script>")
 Response.End()
End Sub %>

call JavaMsg('返回上一页',1)
call JavaMsg('错误:关闭窗口',2)
 

原创粉丝点击