<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!-- 页面加载时弹出一个进度条,10秒后自动关闭 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'listener.jsp' starting page</title>
<!-- 需要引入的ext对象 -->
<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.Msg.buttonText={
yes:' yes',
no:'否',
ok:'确定',
cancel:'取消'
};
Ext.Msg.buttonText.yes='是';
Ext.onReady(function(){
var msgBox = Ext.MessageBox.show({
title:'提示',
msg:'动态更新的进度条和信息文字',
modal:true,
width:300,
progress:true
})
var count = 0;//滚动条被刷新的次数
var percentage = 0;//进度百分比
var progressText = '';//进度条信息
Ext.TaskMgr.start({
run:function(){
count++; //刷新10次后关闭信息提示对话框
if(count > 10){
msgBox.hide();
}
//计算进度
percentage = count/10;
//生成进度条文字
progressText = '已完成:'+percentage*100 + "%";
//更新信息提示对话框
msgBox.updateProgress(percentage,progressText,
'当前时间:'+new Date().format('Y-m-d g:i:s A'));
},
interval:1000
});
});
</script>
</head>
<body>
<input id="btnAlert" type="button" value="会动的时间和进度条" />
</body>
</html>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!-- 页面加载时弹出一个进度条,10秒后自动关闭 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'listener.jsp' starting page</title>
<!-- 需要引入的ext对象 -->
<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.Msg.buttonText={
yes:' yes',
no:'否',
ok:'确定',
cancel:'取消'
};
Ext.Msg.buttonText.yes='是';
Ext.onReady(function(){
var msgBox = Ext.MessageBox.show({
title:'提示',
msg:'动态更新的进度条和信息文字',
modal:true,
width:300,
progress:true
})
var count = 0;//滚动条被刷新的次数
var percentage = 0;//进度百分比
var progressText = '';//进度条信息
Ext.TaskMgr.start({
run:function(){
count++; //刷新10次后关闭信息提示对话框
if(count > 10){
msgBox.hide();
}
//计算进度
percentage = count/10;
//生成进度条文字
progressText = '已完成:'+percentage*100 + "%";
//更新信息提示对话框
msgBox.updateProgress(percentage,progressText,
'当前时间:'+new Date().format('Y-m-d g:i:s A'));
},
interval:1000
});
});
</script>
</head>
<body>
<input id="btnAlert" type="button" value="会动的时间和进度条" />
</body>
</html>