ext--消息框2

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>msgbox.html</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
	<link rel="stylesheet" type="text/css" href="../ext/resources/css/ext-all.css">
	<script type="text/javascript" src="../ext/adapter/ext/ext-base.js"></script>
	<script type="text/javascript" src="../ext/ext-all.js"></script>
	<script type="text/javascript">
		Ext.onReady(function(){
			Ext.get('confirm').on('click',function(){
				Ext.Msg.confirm("提示","你确定要执行该操作吗?",callbackMsg);
			});
			Ext.get('info').on('click',function(){
				Ext.Msg.show(
					{
					title:"提示",
					msg:"操作成功!",
					fn:callbackMsg,
					buttons:Ext.MessageBox.OK,
					icon:Ext.MessageBox.INFO,
					animEl:'info'
				});
			});
			Ext.get('warn').on('click',function(){
				Ext.Msg.show(
					{
					title:"提示",
					msg:"此操作可能存在安全隐患!",
					fn:callbackMsg,
					buttons:Ext.MessageBox.OK,
					icon:Ext.MessageBox.WARNING,
					animEl:'warn'
				});
			});
			Ext.get('error').on('click',function(){
				Ext.Msg.show(
					{
					title:"提示",
					msg:"连接服务器失败,请检查网络!",
					fn:callbackMsg,
					buttons:Ext.MessageBox.OK,
					icon:Ext.MessageBox.ERROR,
					animEl:'error'
				});
			});
			Ext.get('oneline_prompt').on('click',function(){
				Ext.Msg.prompt("提示","请输入姓名:",inputMsg);
			});
			Ext.get('multiLine_prompt').on('click',function(){
				Ext.MessageBox.show({
		           title: '提示',
		           msg: '请输入聊天内容:',
		           width:300,
		           buttons: Ext.MessageBox.OKCANCEL,
		           multiline: true,
		           fn: inputMsg,
		           animEl: 'multiLine_prompt'
       			});
			});
			Ext.get('question').on('click',function(){
				Ext.MessageBox.show({
		           title: '提示',
		           msg: '要执行该操作吗?',
		           width:300,
		           buttons: Ext.MessageBox.OKCANCEL,
		           icon:Ext.Msg.QUESTION,
		           fn: callbackMsg,
		           animEl: 'question'
       			});
			});
			callbackMsg = function(btn) {
				Ext.Msg.show({msg:"You clicked " + btn});
			}
			inputMsg = function(btn,txt) {
				Ext.Msg.show({msg:"You input:"+txt});
			}
			
			Ext.get('test').on('click',function(){
				var f = Ext.Msg.confirm("","ok?",callbackMsg);
			});
		});
	</script>
  </head>
  
  <body>
  	<input type="button" id="confirm" value="Confirm">
  	<input type="button" id="question" value="Question">
    <input type="button" id="info" value="Info">
    <input type="button" id="warn" value="Warn">
    <input type="button" id="error" value="Error">
    <input type="button" id="oneline_prompt" value="OneLinePrompt">
    <input type="button" id="multiLine_prompt" value="MultiLinePrompt">
    <input type="button" id="test" value="test">
  </body>
</html>


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值