ProgressBar Interval : ProgressBar « Dojo toolkit « JavaScript DHTML






ProgressBar Interval

 

<html>
  <head>
    <link rel="StyleSheet" type="text/css" href="js/dojo/dijit/themes/tundra/tundra.css">
    <script type="text/javascript">
      var djConfig = {
        baseScriptUri : "js/dojo/",
        parseOnLoad : true
      };
    </script>
    <script type="text/javascript" src="js/dojo/dojo/dojo.js"></script>
    <script>
            dojo.require("dojo.parser");
            dojo.require("dijit.ProgressBar");

            dojo.addOnLoad(function(  ) {
                var progressInterval = setInterval(function(  ) {
                       dojo.xhrGet({
                            url : "get value from",
                            load : function(response, ioArgs) {
                                alert("load", response);
                                if (response <= 100) {
                                    dijit.byId("pb").update({progress : response});
                                }
                                else  {
                                    clearInterval(progressInterval);
                                }
                            }
                        });
                }, 1000);
            });
    </script>
  </head>
  <body class="tundra">
        <div>Loading...</div>
        <div id="pb" dojoType="dijit.ProgressBar" style="width:300px"></div>
        </div>
  </body>
</html>

   
  








Dojo-toolkit.zip( 3,849 k)

Related examples in the same category

1.ProgressBar creation
2.ProgressBar dialog
3.ProgressBar: maximum value, progress
4.Set value for ProgressBar
5.Create ProgressBar