Skip to content

Instantly share code, notes, and snippets.

@KurtWM
Created February 25, 2014 21:47
Show Gist options
  • Save KurtWM/9218574 to your computer and use it in GitHub Desktop.
Save KurtWM/9218574 to your computer and use it in GitHub Desktop.
var customButtonsCreated = false,
addInfoLinks = function () {
"use strict";
};
$(document).ajaxComplete(function (event, xhr, settings) {
"use strict";
console.log("document.ajaxComplete has fired: " + event + "; " + xhr + "; " + settings.url)
// If the main XMLHttpRequest has completed, update the window.
// As of this writing, the main XMLHttpRequest URL is:
// '/api/v1/events/current?expand=event_slides%2Cevent_videos'
// We look for the main part of the URL using a Regular Expression.
if (/\/api\/v1\/channels\/identity/.test(settings.url)) {
console.log("Running functions after XMLHttpRequest has completed.")
if (!customButtonsCreated) {
addInfoLinks();
customButtonsCreated = true;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment