Skip to content

Instantly share code, notes, and snippets.

@donnielrt
Created September 10, 2013 17:23
Show Gist options
  • Save donnielrt/6512655 to your computer and use it in GitHub Desktop.
Save donnielrt/6512655 to your computer and use it in GitHub Desktop.
So you basically monitor ajaxComplete to see if the elements you want have been created
jQuery(document).bind('ajaxComplete', function(e, xhr, settings) {
// Check to see if this AJAX call is the one you want
if($("#whatever").length) {
// Do something
}
// Or just check the URL to see if it's the AJAX call to the page we want:
if(settings.url.match(/my-url/)) {
// Do something
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment