Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

progress bar loading ajax

 xhr: function() {
                var xhr = new window.XMLHttpRequest();
                xhr.upload.addEventListener("progress", function(evt) {
                    if (evt.lengthComputable) {
                        var percentComplete = Math.ceil((evt.loaded / evt.total) * 100);
                        $(".uk-progress").width(percentComplete + '%');
                        $(".uk-progress").html(percentComplete+'%');
                    }
                }, false);
                return xhr;
            },
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #progress #bar #loading #ajax
ADD COMMENT
Topic
Name
7+5 =