head_0n
07-14-2002, 01:28 PM
hello,
i know it is possible to create some javascript file with scripts available for all my pages - some .js external file. but how can i do that? and how can i call my script from the external file so i can use an onLoad event?
i've used the "gotoURL" behaviour from DW. it gives me a script and the onLoad event.
my "go to URL" script:
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args+".location='"+args[i+1]+"'");
}
//-->
</script>
onLoad event:
<body onLoad="MM_goToURL('parent.frames[\'janelab\']','02-homem1.htm');return document.MM_returnValue"></body>
i've already created a .js file and i know the script to call the file, but how to make the onLoad functioning?
call a .js file:
<script language="JavaScript" src="gotoURL.js" type="text/javascript" ></script>
and the .js file contains the up script without "<script></script>" parts but it doesn't function at all!!!!
you may find my project here:
http://membres.lycos.fr/abelp/ciclo
thanks for all your help.
i know it is possible to create some javascript file with scripts available for all my pages - some .js external file. but how can i do that? and how can i call my script from the external file so i can use an onLoad event?
i've used the "gotoURL" behaviour from DW. it gives me a script and the onLoad event.
my "go to URL" script:
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args+".location='"+args[i+1]+"'");
}
//-->
</script>
onLoad event:
<body onLoad="MM_goToURL('parent.frames[\'janelab\']','02-homem1.htm');return document.MM_returnValue"></body>
i've already created a .js file and i know the script to call the file, but how to make the onLoad functioning?
call a .js file:
<script language="JavaScript" src="gotoURL.js" type="text/javascript" ></script>
and the .js file contains the up script without "<script></script>" parts but it doesn't function at all!!!!
you may find my project here:
http://membres.lycos.fr/abelp/ciclo
thanks for all your help.