Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have found the point, I should put my time out part into the initial part(new dialog judge). because if you raise new timeout in startAjax part, every time you send ajax request there will be a new timeout raised, these loops work together, so the progress bar changes more and more faster. <code>clearTimeout(timeOut);</code>does not work because a new progress function will be raised newly. below is my amended code. may helpful for you~~ <strong>BTW</strong>, can anybody vote me once time? I want to join in chat part, but it need 20 reputation score~~</p> <pre><code>$(document).ajaxStart(function(){ if($(".ui-dialog").length==0){ $reportContent.append("&lt;div id='progressBarDialog'&gt;&lt;div id='progressbar'&gt;&lt;/div&gt;&lt;/div&gt;"); $( "#progressBarDialog #progressbar" ).progressbar({value:false}); var $progressbarDialog = $("#progressBarDialog"); $progressbarDialog.dialog({ modal: true, width:175, height:50, closeOnEscape: false, autoOpen: false }); $(".ui-dialog-titlebar").hide(); function progress() { var val = $progressbar.progressbar( "value" ) || 0; if ( val &lt; 80 ) { $progressbar.progressbar( "value", val + Math.random() * 15 ); timeOut = setTimeout( progress, 500 ); } } setTimeout( progress, 500 ); } var $progressbar = $( "#progressBarDialog #progressbar" ); $progressbar.progressbar( "value",0 ); $("#progressBarDialog").dialog("open"); }); $(document).ajaxStop(function(){ $( "#progressBarDialog #progressbar" ).progressbar( "value",0 ); $("#progressBarDialog").dialog('close'); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload