

Ask HN - Allowing other sites to embed Your content (eg. Hellobar, Qualaroo) - materialhero

I've been searching through the source files forever and can't figure how sites like hellobar.com and qualaroo.com allow someone to embed the companies content on the webmasters site(Never was too great with javascript.) Can anyone explain, or point me in the direction of a good tutorial to walk me through this? Eventually I'd like to figure out how to personalize this based on uID (etc.), but I'll  start with the basics for now. Thank you in advance for any help!
======
andrewmunsell
They host a script, and provide an code to place on your website. You'll need
to learn basic Javascript before you get to the point where you have a script
that changes based on a user ID.

Hellobar (and a service I am working on) provide variable content based on an
ID by requesting a "configuration" file from a server with the provided ID.

~~~
materialhero
Thanks for the quick response. Lets say for the sake of simplicity (and a
short weekend project) that I want to have a <div> on my site that anyone can
copy a code <script type="text/javascript"
src="//www.mycrummysite/mydiv.js"></script> and put on their website so that
it shows the my div. Every time i change the contents of the div, it also
changes on their site. That seems like a good way to start. Is there a quick
way to learn how to do this?

~~~
andrewmunsell
You can't do it that way-- once someone copies the code, it can never be
changed by you. What you _can_ change is the _contents_ of the Javascript
file. For example, when I make an update to my service, I upload the changes
to script.js and the _new_ code is run on the sites that embed that script.

