当前位置:编程学习 > JAVA >>

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,"加载失败"); 
     }www.zzzyk.com
    })
   },
   interval:500
  }
  Ext.TaskMgr.start(task);
   
 });
</script>
 
 
jsp中代码
<%
 System.out.println("加载数据中...");
 String curr=request.getParameter("curr");
 System.out.println(curr);
 out.println(curr+100);
%>
补充:web前端 , JavaScript ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,