对话框的使用

来源:互联网 发布:淘宝快递破损怎么处理 编辑:程序博客网 时间:2024/04/30 04:25

JavaScript中对话框的使用:

1、警告对话框:带一个确定按扭。
<script language=javascript>
 alert('对话框显示的文本');
 window.location='点确定按扭时跳转到的页面';
</script>
2、选择对话框:带确定和取消按扭。
<script language='javascript'>
 if (confirm('对话框显示的文本'))
  window.location='点确定按扭时跳转到的页面';
 else
  window.location='点取消按扭时跳转到的页面';
</script>


将他们写成ASP函数,方便调用:

'---------------弹出对话框1(带确定按钮,点击后返回指定链接)-------------
'使用示例Message1(MyPageInfo&"修改成功!",MyCgiUrl&"?MyPage="&strMyPage)
Sub Message1(MessageText,ReturnUrl)
 Response.Write(""&_
 "<script language=javascript>"&_
 "alert('"&MessageText&"');"&_
 "window.location='"&ReturnUrl&"';"&_
 "</script>"&_
 "")
 Response.End
End Sub
'-----------------------------------------—----------------------------

'---------------弹出对话框2(带确定和取消按钮,点击后各自返回各自指定链接)-------------
'使用示例Message2("确定要删除此类别?",MyCgiUrl&"?

MyMode=Del&ID="&strID&"&MyPage="&strMyPage,"javascript:window.history.back();")
Sub Message2(MessageText,ReturnUrl,CancelReturnUrl)
 Response.Write(""&_
 "<script language=javascript>"&_
 "if (confirm('"&MessageText&"'))"&_
 " window.location='"&ReturnUrl&"';"&_
 "else"&_
 " window.location='"&CancelReturnUrl&"';"&_
 "</script>"&_
 "")
 Response.End
End Sub
'-----------------------------------------—----------------------------

lotusScript中对话框的使用:

msgbox(messagebox)如果在notes端执行,弹出一个对话框,如果在服务器端执行,在后台打印出来

lotus公式:@prompt:弹出一个选择对话框

                 @DialogBox:弹出一个模态对话框来展现当前文档

                 @PickList:

原创粉丝点击