Posts with tag widgets

Tips to implement an embeddable widget

Embeddable widgets (or gadgets) allow users to easily include functionality provided by another site. Some examples are Twitter button or the Facebook like button, but also more complex ones like Disqus comments. They can be included on a site easily, normally through an iframe or some JS snippet which will create an iframe. Although at first sight these widgets seem basic, lots of things need to be taken into account when implementing one.

Continue reading about Tips to implement an embeddable widget...

Using C3PO to load Spotify Play Button

C3PO is a small library developed by Stoyan Stefanov (I bet you know him, otherwise you should) as a way of getting rid off 3rd party Javascript code to load social widgets.

It allows injecting these widgets as iframes, instead of defining their containers and use certain 3rd party JS code to create and inject those iframes. In addition, it provides a simple parse function that you can call whenever you want to initialize these widgets. In addition, it exposes a way to send messages from the widget to the parent page using postMessage. In his example, the widget sends a resize message, that the parent element captures and changes the size of that widget accordingly.

Continue reading about Using C3PO to load Spotify Play Button...