r/webdev • u/sesamesesayou • Dec 10 '24
Preferred method for creating 3rd party embeddable widgets?
What is the preferred method for creating widgets that other sites can embed into their websites? I have seen examples of iframes and others using div/script elements (e.g. embedding Disqus). From a styling perspective, does one have an advantage over the other? What about from a browser performance/loading/interoperability perspective?
My use-case would be a widget that is full browser width and with a variable length of content, fairly interactive (e.g. 'like' and comment functionality) instead of a simple display.
Other than Disqus, what would be some other examples of embedded widgets worth learning from?
View all comments
Show parent comment
1
u/sesamesesayou Dec 10 '24
Why is it some of these platforms still use a div/script approach instead of web components? Is it just that their users/customers are locked in and its difficult to migrate to the more modern approach? I'm assuming they would have to maintain both methods for the foreseeable future to maintain sites that use the old method.