Ext 进度条Ajax取值

前端之家收集整理的这篇文章主要介绍了Ext 进度条Ajax取值前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

<link rel="stylesheet" href="ext-3.2.1/resources/css/ext-all.css"/>
<script type="text/javascript" language="javascript" src="ext-3.2.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" language="javascript" src="ext-3.2.1/ext-all.js"></script>
<script type="text/javascript" language="javascript" src="ext-3.2.1/examples/shared/examples.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
var pbar= new Ext.ProgressBar({
id:'pbar',
width:300,
value:100,
renderTo:Ext.getBody()
});
var task={
run:function(){
Ext.Ajax.request({
url:'ProgressBar.jsp',
params:{curr:pbar.value},
success:function(response,options){
var value=response.responseText;
pbar.updateProgress(parseFloat(value),Math.random(parseInt(value*100))+"%");
if(Math.random(parseInt(value*100))==100){
pbar.updateText("加载完成");
Ext.TaskMgr.stop(task);
}
},
failure:function(){
Ext.DomHelper.insertHmtl('beforeEnd',Ext.getBody().dom,"加载失败");
}
})
},
interval:500
}
Ext.TaskMgr.start(task);

});
</script>

jsp中代码

<% System.out.println("加载数据中..."); String curr=request.getParameter("curr"); System.out.println(curr); out.println(curr+100); %>

原文链接:https://www.f2er.com/ajax/166716.html

猜你在找的Ajax相关文章