Menu

1 / 2

Building a free embeddable widget that earns attribution honestly: iframe + credit line design

DEV Community: javascript·MeetAndPlay·10 days ago
#miO1gs9w
#devtojavascript#devto#dev#embed#const
Reading 0:00
15s threshold

We ship small embeddable widgets (a club availability view, a court-cost calculator, a data chart) that other sites can put on a page. This post is about the design decisions: how the iframe is locked down, how it resizes without hand-tuning, and how the credit line is built so the attribution is visible, optional to remove, and not a trick.

Two pieces: a loader and an embed route

The host page adds a script and a placeholder:

<script src= "https://meetandplay.mx/embed.js" async ></script> <div data-meetandplay-club= "club-slug" ></div>

Enter fullscreen mode

Exit fullscreen mode

The script finds each placeholder, builds an iframe pointing at a dedicated /embed/... route on our domain, and inserts it.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.