

How does Twitter share link work? - diggan

An example:
"&#60;a href="http://twitter.com/share" class="twitter-share-button" data-text="List scroll effects applied via CSS. Created by @hakimel" data-url="http://lab.hakim.se/scroll-effects" data-count="small" data-related="hakimel"&#62;&#60;/a&#62;"<p>How does Twitter catch the data attributes being passed to twitter.com/share?
======
daegloe
That's not exactly how it works.

When embedding a Tweet button using the Twitter JavaScript API, you also need
to include a script reference to //platform.twitter.com/widgets.js. This code
scans the DOM, reads those data attributes and then replaces the href above
with an iframe. That iframe contains the Tweet button with the data attribute
values serialized into a new href that triggers the popup.

~~~
diggan
That explains it. Thanks for explaining!

