My first attempt at posting a reply appears to have been "eaten"...so I'll give it another go.
I don't know if you're still looking for a solution to this issue, but a solution that has worked well for us is to use the RegisterClientScriptBlock method to inject your javascript (or RegisterClientScriptInclude to write an external reference to your source .js file) into the head section of the page.
To do this add a code-behind file to your skin.ascx file (or, alternatively, you can add the following to your skin.ascx file inline using <script runat="server"> tags. (The following is in C#.
public
partial
class
MainSkin : DotNetNuke.UI.Skins.Skin
{
protected
void
Page_Load(
object
sender, EventArgs e){
System.Web.UI.ClientScriptManager CSM =
new
ClientScriptManager();
CSM.RegisterClientScriptInclude(
"Key"
,SkinPath +
"js/source.js"
);
}
}
The important part is what appears in the Page_Load event. The "Key" is a name that you can assign to that particular script include that you can use to check if you've already loaded the script with that "key" on the page using the
CSM.IsClientScriptIncludeRegistered("Key"); should you be trying to load the .js from a container file rather than the skin file. That way, the javascript is injected only once, regardless of how many times a container may appear on your page. This would more commonly be done through custom user controls, but if you had a special container that made use of a rather large jQuery plugin that you only wanted to load if the container was present on the page, this would serve that need.
Obviously, the second parameter in the method above is the path to your js file, starting from the SkinPath.
I hope that helps.