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.
The most o
You have to have MakeWidget
defined somewhere, right? Presumably this is going to be in an external script. Why not just have the external script source just attach itself to the divContent
using the window.onload
method?
This would result in this code on your client's page:
Your makewidget.js
code could then look like this:
window.onload = function() { MakeWidget('divContent') }
There may some issues with other scripts loading and probably some cross-browser compatibility issues but that should get you pointed in the right direction.