Twitter Profile Widget breaks Web Intents javascript


#1

Hi,

It appears that both Web Intents and Profile Widget (and other widgets as well would be my guess, but I haven’t tested it) use twttr javascript object. The problem is that they both require different versions of this object so they end up replacing each others created object depending on which one loads first. This makes it impossible to reliably use Web Intents events and would probably break the Profile Widget itself as well.

Is there a workaround for this problem or could it be fixed somehow?

I use this snippet to include the widgets.js for Web Intents:

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”));

and code from this page: https://twitter.com/about/resources/widgets/widget_profile for Profile Widget.

Thanks,

Rolands.


#2

thx


#3

help me plz. ช่วยด้วย


#4