Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Packets percent
- abc 10%
- efs 13%
- var wait = function(condFunc, readyFunc, checkInterval) {
- var checkFunc = function() {
- if(condFunc()) {
- readyFunc();
- }
- else
- {
- setTimeout(checkFunc, checkInterval);
- }
- };
- checkFunc();
- };
- wait(
- function() { return new Date().getSeconds() == 10; },
- function() { console.log("Done"); },
- 100
- );
- function progress() {
- el = this;
- $.get("/path/to/rest/call", function(data) {
- el.textContent = data + "%";
- // define conditions for next request
- if (data < 100 /* conditions */) {
- progress.call(el)
- }
- })
- }
- $("table tr").each(function() {
- progress.call(this)
- })
Add Comment
Please, Sign In to add comment