Created
May 8, 2012 13:16
-
-
Save bitlyfied/2634874 to your computer and use it in GitHub Desktop.
Enablin functional tests to wait for ajax requests
This file contains hidden or 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
/************************************************* | |
* Detecting ajax calls | |
*/ | |
// bind a function to the start of every ajax call on the page | |
$("body").bind("ajaxStart", function(){ | |
$("html").attr("data-processingAjax", true); | |
}); | |
// bind a function to the end of every ajax call on the page | |
$("body").bind("ajaxStop", function(){ | |
$("html").removeAttr("data-processingAjax"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment