so this is what i have at the head of my html:
<script src="scripts/myScript.js" type="text/javascript"></script>
(i have nothing else at the head aside from a css call.)
This is what i have in my external javascript doc:
// JavaScript Document
<script id="WindowLoad" type="text/javascript">
// The following three functions can either be hard-coded in your page
// or in the myScript.js file.
function function1() {
function MM_swapImgRestore() { //v3.0
var u,x,w=document.MM_sr; for(u=0;w&&u<w.length&&(x=w[u])&&x.oSrc;u++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var u,j=d.MM_p.length,w=MM_preloadImages.arguments; for(u=0; u<w.length; u++)
if (w[u].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=w[u];}}
}
function MM_findObj(n, d) { //v4.01
var p,u,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (u=0;!x&&u<d.forms.length;u++) x=d.forms[u][n];
for(u=0;!x&&d.layers&&u<d.layers.length;u++) x=MM_findObj(n,d.layers[u].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var u,j=0,x,w=MM_swapImage.arguments; document.MM_sr=new Array; for(u=0;u<(w.length-2);u+=3)
if ((x=MM_findObj(w[u]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=w[u+2];}
}
}
function function2() {
if(!window.Node){
var Node = {ELEMENT_NODE : 1, TEXT_NODE : 3};
}
function checkNode(node, filter){
return (filter == null || node.nodeType == Node[filter] || node.nodeName.toUpperCase() == filter.toUpperCase());
}
function getChildren(node, filter){
var result = new Array();
var children = node.childNodes;
for(var i = 0; i < children.length; i++){
if(checkNode(children[i], filter)) result[result.length] = children[i];
}
return result;
}
function getChildrenByElement(node){
return getChildren(node, "ELEMENT_NODE");
}
function getFirstChild(node, filter){
var child;
var children = node.childNodes;
for(var i = 0; i < children.length; i++){
child = children[i];
if(checkNode(child, filter)) return child;
}
return null;
}
function getFirstChildByText(node){
return getFirstChild(node, "TEXT_NODE");
}
function getNextSibling(node, filter){
for(var sibling = node.nextSibling; sibling != null; sibling = sibling.nextSibling){
if(checkNode(sibling, filter)) return sibling;
}
return null;
}
function getNextSiblingByElement(node){
return getNextSibling(node, "ELEMENT_NODE");
}
// Menu Functions & Properties
var activeMenu = null;
function showMenu() {
if(activeMenu){
activeMenu.className = "";
getNextSiblingByElement(activeMenu).style.display = "none";
}
if(this == activeMenu){
activeMenu = null;
} else {
this.className = "active";
getNextSiblingByElement(this).style.display = "block";
activeMenu = this;
}
return false;
}
function initMenu(){
var menus, menu, text, a, i;
menus = getChildrenByElement(document.getElementById("menu "));
for(i = 0; i < menus.length; i++){
menu = menus[i];
text = getFirstChildByText(menu);
a = document.createElement("a");
menu.replaceChild(a, text);
a.appendChild(text);
a.href = "#";
a.onclick = showMenu;
a.onfocus = function(){this.blur()};
}
}
if(document.createElement) window.onload = initMenu;
}
function function3() {
// code here something
}
window.onload = function() {
function1(); // execute function 1.
function2(); // execute function 2.
function3(); // execute function 3.
};
</script>
----------------------------------------------------------
WHAT AM I DOING WRONG???
