Skip to content

Instantly share code, notes, and snippets.

@nleush
Created February 13, 2019 13:24
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 nleush/fa069b3434e6784798b625be7c7391f9 to your computer and use it in GitHub Desktop.
Save nleush/fa069b3434e6784798b625be7c7391f9 to your computer and use it in GitHub Desktop.
Twitter error check
var t = window.twttr = window.twttr || {};
t._e = t._e || [];
t.ready = function(f) {
t._e.push(f);
};
twttr.ready(function (twttr) {
twttr.events.bind(
'loaded',
function (event) {
event.widgets.forEach(function (widget) {
if (!widget.id || !widget.id.match(/^twitter-widget/)) {
// handle the tweet disappearance here
}
});
}
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment