As stated before: Do not change default.aspx!
Using ascx skinning you add a javascript link to the head like this:
(Put this in the script part of the skin)
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'add a script reference for Javascript to the head section
Dim oLink As New HtmlGenericControl("script")
oLink.Attributes("language") = "javascript"
oLink.Attributes("type") = "text/javascript"
oLink.Attributes("src") = SkinPath & "extra.js"
Dim oCSS As Control = Me.Page.FindControl("CSS")
If Not oCSS is Nothing Then
oCSS.Controls.AddAt(0, oLink)
End if
End Sub
You can also add the scripts at the bottom of the skin/page (which in fact is better for performance) read this
If you want to add an "onload" you can do this realiably from your JS file like this:
//Add function to load event of page
if (window.addEventListener){
window.addEventListener("load", MyFunction, false);
}
else if (window.attachEvent){
window.attachEvent ("onload", MyFunction)
}
I think it would de good if in a future version of the skinning engine DNN would process the existing links in an HTML skin.