Skip to content

Instantly share code, notes, and snippets.

@isaulv
Created April 29, 2014 21:42
Show Gist options
  • Save isaulv/2dacbeafb78019a44016 to your computer and use it in GitHub Desktop.
Save isaulv/2dacbeafb78019a44016 to your computer and use it in GitHub Desktop.
async script
var callback = arguments[arguments.length - 1];
var any_activity_yet = false;
var checkInactive = function() {
var result = (window.jQuery != null) && (jQuery.active === 0);
if ((result == true) && (any_activity_yet == true))
{return callback();}
if (result == false)
{any_activity_yet = true;}
setTimeout(checkInactive, 250);
}
checkInactive();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment