Created
April 29, 2014 21:42
-
-
Save isaulv/2dacbeafb78019a44016 to your computer and use it in GitHub Desktop.
async script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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