Js的MessageBox http://bbs.blueidea.com/thread-2697900-1-1.html

看到论坛上有人模仿alert 自己也写了一个
本来想模仿winapi里的MessageBox
但可惜js 不支持 阻塞模式 
返回值只能用异步了。
支持 FF ie opera
DOCTYPE 可以申明 也可以不申明
存在问题 
在opera 里图层不能透明 
对于页面内有iframe的也无法使用
在ie里无法遮住select的

 提示:您可以先修改部分代码再运行 
解释代码:namespace System.Windows { // // 摘要: // Displays a message box. public sealed class MessageBox { // // 摘要: // Displays a message box that has a message and that returns a result. // // 参数: // messageBoxText: // A System.String that specifies the text to display. // // 返回结果: // A System.Windows.MessageBoxResult value that specifies which message box button // is clicked by the user. public static MessageBoxResult Show(string messageBoxText); // // 摘要: // Displays a message box that has a message and title bar caption; and that returns // a result. // // 参数: // messageBoxText: // A System.String that specifies the text to display. // // caption: // A System.String that specifies the title bar caption to display. // // 返回结果: // A System.Windows.MessageBoxResult value that specifies which message box button // is clicked by the user. public static MessageBoxResult Show(string messageBoxText, string caption); // // 摘要: // Displays a message box that has a message, title bar caption, and button; and // that returns a result. // // 参数: // messageBoxText: // A System.String that specifies the text to display. // // caption: // A System.String that specifies the title bar caption to display. // // button: // A System.Windows.MessageBoxButton value that specifies which button or buttons // to display. // // 返回结果: // A System.Windows.MessageBoxResult value that specifies which message box button // is clicked by the user. public static MessageBoxResult Show(string messageBoxText, string caption, MessageBoxButton button); // // 摘要: // Displays a message box that has a message, title bar caption, button, and icon; // and that returns a result. // // 参数: // messageBoxText: // A System.String that specifies the text to display. // // caption: // A System.String that specifies the title bar caption to display. // // button: // A System.Windows.MessageBoxButton value that specifies which button or buttons // to display. // // icon: // A System.Windows.MessageBoxImage value that specifies the icon to display. // // 返回结果: // A System.Windows.MessageBoxResult value that specifies which message box button // is clicked by the user. public static MessageBoxResult Show(string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon); // // 摘要: // Displays a message box that has a message, title bar caption, button, and icon; // and that accepts a default message box result and returns a result. // // 参数: // messageBoxText: // A System.String that specifies the text to display. // // caption: // A System.String that specifies the title bar caption to display. // // button: // A System.Windows.MessageBoxButton value that specifies which button or buttons // to display. // // icon: // A System.Windows.MessageBoxImage value that specifies the icon to display. // // defaultResult: // A System.Windows.MessageBoxResult value that specifies the default result of // the message box. // // 返回结果: // A System.Windows.MessageBoxResult value that specifies which message box button // is clicked by the user. public static MessageBoxResult Show(string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult); // // 摘要: // Displays a message box that has a message, title bar caption, button, and icon; // and that accepts a default message box result, complies with the specified options, // and returns a result. // // 参数: // messageBoxText: // A System.String that specifies the text to display. // // caption: // A System.String that specifies the title bar caption to display. // // button: // A System.Windows.MessageBoxButton value that specifies which button or buttons // to display. // // icon: // A System.Windows.MessageBoxImage value that specifies the icon to display. // // defaultResult: // A System.Windows.MessageBoxResult value that specifies the default result of // the message box. // // options: // A System.Windows.MessageBoxOptions value object that specifies the options. // // 返回结果: // A System.Windows.MessageBoxResult value that specifies which message box button // is clicked by the user. public static MessageBoxResult Show(string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult, MessageBoxOptions options); // // 摘要: // Displays a message box in front of the specified window. The message box displays // a message and returns a result. // // 参数: // owner: // A System.Windows.Window that represents the owner window of the message box. // // // messageBoxText: // A System.String that specifies the text to display. // // 返回结果: // A System.Windows.MessageBoxResult value that specifies which message box button // is clicked by the user. public static MessageBoxResult Show(Window owner, string messageBoxText); // // 摘要: // Displays a message box in front of the specified window. The message box displays // a message and title bar caption; and it returns a result. // // 参数: // owner: // A System.Windows.Window that represents the owner window of the message box. // // // messageBoxText: // A System.String that specifies the text to display. // // caption: // A System.String that specifies the title bar caption to display. // // 返回结果: // A System.Windows.MessageBoxResult value that specifies which message box button // is clicked by the user. public static MessageBoxResult Show(Window owner, string messageBoxText, string caption); // // 摘要: // Displays a message box in front of the specified window. The message box displays // a message, title bar caption, and button; and it also returns a result. // // 参数: // owner: // A System.Windows.Window that represents the owner window of the message box. // // // messageBoxText: // A System.String that specifies the text to display. // // caption: // A System.String that specifies the title bar caption to display. // // button: // A System.Windows.MessageBoxButton value that specifies which button or buttons // to display. // // 返回结果: // A System.Windows.MessageBoxResult value that specifies which message box button // is clicked by the user. public static MessageBoxResult Show(Window owner, string messageBoxText, string caption, MessageBoxButton button); // // 摘要: // Displays a message box in front of the specified window. The message box displays // a message, title bar caption, button, and icon; and it also returns a result. // // // 参数: // owner: // A System.Windows.Window that represents the owner window of the message box. // // // messageBoxText: // A System.String that specifies the text to display. // // caption: // A System.String that specifies the title bar caption to display. // // button: // A System.Windows.MessageBoxButton value that specifies which button or buttons // to display. // // icon: // A System.Windows.MessageBoxImage value that specifies the icon to display. // // 返回结果: // A System.Windows.MessageBoxResult value that specifies which message box button // is clicked by the user. public static MessageBoxResult Show(Window owner, string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon); // // 摘要: // Displays a message box in front of the specified window. The message box displays // a message, title bar caption, button, and icon; and accepts a default message // box result and returns a result. // // 参数: // owner: // A System.Windows.Window that represents the owner window of the message box. // // // messageBoxText: // A System.String that specifies the text to display. // // caption: // A System.String that specifies the title bar caption to display. // // button: // A System.Windows.MessageBoxButton value that specifies which button or buttons // to display. // // icon: // A System.Windows.MessageBoxImage value that specifies the icon to display. // // defaultResult: // A System.Windows.MessageBoxResult value that specifies the default result of // the message box. // // 返回结果: // A System.Windows.MessageBoxResult value that specifies which message box button // is clicked by the user. public static MessageBoxResult Show(Window owner, string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult); // // 摘要: // Displays a message box in front of the specified window. The message box displays // a message, title bar caption, button, and icon; and accepts a default message // box result, complies with the specified options, and returns a result. // // 参数: // owner: // A System.Windows.Window that represents the owner window of the message box. // // // messageBoxText: // A System.String that specifies the text to display. // // caption: // A System.String that specifies the title bar caption to display. // // button: // A System.Windows.MessageBoxButton value that specifies which button or buttons // to display. // // icon: // A System.Windows.MessageBoxImage value that specifies the icon to display. // // defaultResult: // A System.Windows.MessageBoxResult value that specifies the default result of // the message box. // // options: // A System.Windows.MessageBoxOptions value object that specifies the options. // // 返回结果: // A System.Windows.MessageBoxResult value that specifies which message box button // is clicked by the user. public static MessageBoxResult Show(Window owner, string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult, MessageBoxOptions options); } }
09-06
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值