Andy: Externe JavaScript einbauen

Beitrag lesen

Also ich habe folgende JavaScript Datei:
<script language="Javascript">
<!--
var w = 100;
var h = 70;
var n = (document.layers) ? 1:0;
var ie = (document.all) ? 1:0;
function makeObj(obj,nest){
nest=(!nest) ? '':'document.'+nest+'.'
this.css=(n) ? eval(nest+'document.'+obj):eval(obj+'.style')
this.evnt=(n)? eval(nest+'document.'+obj):eval(obj);
this.moveIt=b_moveIt;}
function b_moveIt(x,y){
this.x=x; this.y=y
this.css.left=this.x
this.css.top=this.y}
var pageWidth,pageHeight
function init(){
oTest=new makeObj('divBottom')
pageWidth=(ie)?document.body.offsetWidth-4:innerWidth;
pageHeight=(ie)?document.body.offsetHeight-2:innerHeight;
checkIt()
if(ie) window.onscroll=checkIt;}
function f(){alert(f)}
function checkIt(){
if(ie) oTest.moveIt(document.body.scrollLeft+pageWidth-w,document.body.scrollTop+pageHeight-h)
else if(n){oTest.moveIt(window.pageXOffset+pageWidth-w, window.pageYOffset+pageHeight-h)
setTimeout('checkIt()',20)}}
//-->
</script>

Diese wird mit meinem <body onload="init()" aufgerufen! Doch wenn ich die extern aufrufen will, funzt das nicht.

Eine dämliche Frage: Muss das in den Head oder in den Body. Es funzt in beidem nicht!