Hi Jon,
To dinamically load scripts on demand in my applications, I now use the dnn.dom.loadScript method from dnn.js.
To make life more convenient I found this technique, which allows to load scripts, directly from embedded resources.
Here's one example of how this technique can be applied:
File: dnn.js , line 1022
dnn.dom.loadScript(dnn.dom.getScriptPath() + 'dnn.scripts.js', null, oRef(aSrc, aText, callBack));
can be changed in:
dnn.dom.loadScript('<%=WebResource("dnn.scripts.js")%>', null, oRef(aSrc, aText, callBack));
Now, to allow the url substitution, we need to set the required attribute for the dnn.js:
<Assembly: System.Web.UI.WebResource("dnn.js", "text/javascript", PerformSubstitution:=True)>
Finally, we have to embed the dnn.scripts.js
<Assembly: System.Web.UI.WebResource("dnn.scripts.js", "text/javascript")>
I hope this helps.
Regards
Manzoni Fausto