I have some javascript which will create some sort of widget on a page. I will be giving this snippet to clients so I want them to have to do very little.
I would think it would be possible to do it as follows:
The end result should be (if I understand your description correctly) that MakeWidgets will replace the contents of the DIV, which, in this case, is the script itself.