TypeError: twttr is undefined @ http://platform.twitter.com/widgets.js:10


#1

I’m getting the following error on FireFox 23, some of the time:

TypeError: twttr is undefined @ http://platform.twitter.com/widgets.js:10

I am loading the file asynch with this code:

		window.twttr = (function (d,s,id) {
			var t, js, fjs = d.getElementsByTagName(s)[0];
			if (d.getElementById(id)) return; js=d.createElement(s); js.id=id;
			js.src="//platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs);
			return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } });
		}(document, "script", "twitter-wjs"));

#2

I had the same problem.
Add this in the code in ajax-call:
$.getScript(‘https://platform.twitter.com/widgets.js’, function(){
//calling method load
twttr.widgets.load();
});