MicheLM: Denkfehler ?

Beitrag lesen

Hallo,
bin auf die verrückte Idee gekommen, alten Browsern etwas DOM2 beizubringen - aber heute ist nicht mein Tag - wo sind die Denkfehler ?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<script language="JavaScript1.2" >
<!--
if (document.layers){
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
alert(netscape.security.status);
window.onError=this.location.href="javascript:";
// auch'n Denkfehler *grrr*

document.prototype.getElementByName=new Function();
function getElementByName(layername)
{
this.prototype.childNodes=new Array();
this.childNodes=this.document.layers;
this.prototype.style=new Object();
this.style.prototype.left=this.posLeft;
this.style.prototype.top=this.posTop;
this.style.prototype.width=this.width;
this.style.prototype.height=this.height;
this.style.prototype.zIndex=this.zIndex;
this.style.prototype.position=this.position;
this.style.prototype.backgroundColor=this.bgcolor;
this.style.prototype.color=this.color;

this.prototype.hasChildnodes=new Function();
function hasChildnodes(){
return (caller.document.layers.length>=1)?true:false;
}

return eval("document."+layername);
}//end Function

document.prototype.getElementById=new Function();

document.getElementById=document.getElementByName;

} //end if NN4

if(document.all&&!document.getElementById){
document.prototype.getElementById=new Function();
document.getElementById=document.all;
document.getElementById.prototype.childNodes=new Array();

// wie childNodes erzeugen ???

document.getElementById.prototype.firstChild=new Function();
function firstChild(){
return (caller.childNodes[0]);}

} // end if IE old
//-->
</script>
<script language="JavaScript" type="text/javascript">
<!--
// testscript //
function test(){
alert(document.getElementById("neuSpan").style.top+" Top ");
}
//-->
</script>

<html>
<head>
<title>Untitled</title>
</head>
<body onload="test()">

<div name="neuDIV" id="neuDIV" style="position:absolute;border:ridge 1px solid;top:40px;" position="absolute" top="40px" >DIV</DIV>
<span name="neuSpan" id="neuSpan" style="position:absolute;border:ridge 1px solid;top:340px;">span tag</span>

</body>
</html>

Danke vielmal ;-)

Michael--
Hier bin ich Mensch, hier schreib ich rein