Note that there are some explanatory texts on larger screens.

plurals
  1. POjavascript not updating a variable
    text
    copied!<p>I have a asp.net application which i am trying to create a progress bar which run with the system, I am using Java Script to do the update progress and would like an idea on how i would be update <code>var update = 0;</code> and this <code>$("#progressbar").progressbar('value', update);</code> in the code below without using a for loop, as i all ready have used a for loop and booleans, the system throws an error of a long running progra. the rest of the java script code is blow, I would like to update it up to the value of 60; </p> <p><strong>JavaScript which is being called</strong></p> <pre><code> $.updateProgressbar = function () { //Calling PageMethod for current progress PageMethods.OperationProgress(function (result) { //Updating progress $("#progressbar").progressbar('value', result.progress) //If operation is complete if (result.progress == 100) { //Enable button $("#Confirm_btn").attr('disabled', ''); } //If not else { //Reset timer setTimeout($.updateProgressbar, 10); } }); }; $(document).ready(function () { //Progressbar initialization $("#progressbar").progressbar({ value: 0 }); //Button click event $("#Confirm_btn").click(function (e) { e.preventDefault(); //Disabling button $('#error').text(""); $("#Confirm_btn").attr('disabled', 'disabled'); var update = 0; //Making sure that progress indicate 0 $("#progressbar").progressbar('value', update); //Call PageMethod which triggers long running operation PageMethods.Operation(function (result) { if (result) { //Updating progress $("#progressbar").progressbar('value', result.progress) //Setting the timer setTimeout($.updateProgressbar, 5); } }); }); }); </code></pre>
 

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