1
6 Comments

What technology do you use to embed a third part widget into a web page?

Ideally something more elegant than an iframe. I've looked around a bit, but I'm not finding much in the way of other people's solutions.

  1. 2

    What's wrong with an iFrame? I have went down that path with my latest product. It greatly reduces any conflicts and modifications from client side as it's all managed on your side. It's a combination of VueJS and outputting on their page as an iFrame! Big companies lift Intercom and Drift use a combination of iFrames too.

    What kind of widget are you making?

  2. 1

    It would depend on the widget but as Shawn & Daniel say, Javascript might be a good way to do it depending on what you need the widget to do (if it needs to load multiple pages then an iframe would be better).

  3. 1

    Yup, javascript. Minify it, uglify it, and put it on a CDN for delivery.

  4. 1

    You can use javascript and a div then just have your javascript generate and write the html into the div.

    1. 1

      What about preventing the site's css from clashing with your own?

      1. 1

        Inline and don't use anything that Cascades or prefix your classnames with a random string.