Created
February 25, 2014 21:47
-
-
Save KurtWM/9218574 to your computer and use it in GitHub Desktop.
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
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