Skip to content

Instantly share code, notes, and snippets.

@stuwilli
Last active August 29, 2015 14:20
Show Gist options
  • Save stuwilli/6e2c1e77835e30cd55ea to your computer and use it in GitHub Desktop.
Save stuwilli/6e2c1e77835e30cd55ea to your computer and use it in GitHub Desktop.
Kickstart FW LinkTag From Head
(function() {
function kickStartLinkTag() {
if (typeof brightcove !== 'undefined') {
if (Object.keys(brightcove.experiences).length === 0) {
if (typeof AdOps !== 'undefined' && typeof AdOps.fw !== 'undefined') {
AdOps.fw.initLinkTag();
}
}
}
}
if (document.addEventListener) {
document.addEventListener('DOMContentLoaded', kickStartLinkTag);
} else {
document.attachEvent('onreadystatechange', function() {
if (document.readyState === 'interactive') {
kickStartLinkTag();
}
});
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment