title: jquery ajax call to update progressbar
body: <p>I would like to update a jquery progress bar value with the value of percentage complete of a particular process. Basically i have the following function:</p>
  
  <pre><code>function updateProgressBar() {
  
  $.ajax({
      url: "WebService/DataServices.asmx/getPercentage",
      dataType: "text",
      type: "POST",
      data: {},
      success: function (value) {
          $("#progress2").html(value);          
          $("#progress-sample").progressbar({
              value: parseInt(value)
          });
      }
  });
  }
  </code></pre>
  
  <p>the function basically make an ajax request to a webmethod getPercentage which calculates the percentage completed. the function is then called every 5 seconds using </p>
  
  <pre><code>$(document).ready(setInterval(updateProgressBar, 5000));
  </code></pre>
  
  <p>For some reason the progress bar value is not being set when the web app is run. I added a <code>div</code> with id <code>progress2</code> and the value is reflected successfully however not the progressbar value. When setting the progress bar value hardcoded it works fine though. Any ideas please?</p>
  
  <p>Thanks</p>