javascript - Ajax progress bar with a big list -


i have ajax call grabbing large json list. there way can make progress bar gets real value of json load (for example status bar says 1 out of 200 loaded)?

right have pretty basic ajax call

function sendajax(urlmethod, jsondata, returnfunction) {     $.ajax({         type: "get",         contenttype: "application/json; charset=utf-8",         url: urlmethod,         data: jsondata,         datatype: "json",         success: function (msg) {             if (msg != null) {                 returnjson(msg);             }         },         error: function (xhr, status, error) {             // boil asp.net ajax error down json.              var err = eval("(" + xhr.responsetext + ")");              // display specific error raised server             alert(err.message);         }     }); } 

try using ajaxstart on application global scope. means can put code in layout file, , if processing long, show progress indicator...

$(document).ajaxstart(function() {    $( "#loading" ).show();  }); 

you can see example , answer @ preload percentage - javascript/jquery.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -