Folgendes Beispiel:
<html>
<head>
<title></title>
</head>
<script LANGUAGE="JavaScript">
<!--
function init(){
stest = new Image();stest.src = "images/chat0.jpg";
if (document.layers) {
document.test_lay.document.open();
document.test_lay.document.write('<IMG SRC="'+stest.src+'" NAME="test_img" HEIGHT=60 WIDTH=90>');
document.test_lay.top = 100;
document.test_lay.left = 100;
document.test_lay.document.close();
} else if (document.all) {
document.all.test_div.innerHTML = '<IMG SRC="'+stest.src+'" NAME="test_img" HEIGHT=60 WIDTH=90>'
with (test_div.style) {
left =100;top =100;
}
}
}
function testfunc (x){
alert(x);
}
//-->
</script>
<body id=body_id onload="init()">
<DIV id="test_div" style="position:absolute; left:0; top:-200; z-index:0"; onclick="testfunc(0)">
<LAYER name="test_lay" onclick="testfunc(0)"></LAYER>
</DIV>
</body>
</html>
Im Internet Explorer funktioniert es, er steigt in die function testfunc ein und gibt "0" aus. Aber Im Netscape tut sich überhaupt nichts! Was hab ich falsch gemacht?