Skip to content

Instantly share code, notes, and snippets.

@bitlyfied
Created May 8, 2012 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitlyfied/2634874 to your computer and use it in GitHub Desktop.
Save bitlyfied/2634874 to your computer and use it in GitHub Desktop.
Enablin functional tests to wait for ajax requests
/*************************************************
* 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