I have javascript that will create some kind of widget on the page. I will give this fragment to clients, so I want them to do very little.
The most obvious solution I'm working with now is something like this:
<div id="divContent"></div>
<script type="text/javascript">
MakeWidget('divContent');
</script>
The make widget basically searches for the divContent div and populate it with my html widgets.
Is there a better way to do this? Can you replace the Script tag with a Div using Javascript in the Script tag?
I would really like it if I could reduce the code to only the MakeWidget function, and it would replace itself and the Script tag with the html that the function generates.
Change I want to generate HTML exactly where the MakeWidget function is called on the page.