Wilhelm: onclick Netscape - BITTE! Ich weiß nicht mehr weiter!

Beitrag lesen

so funktioniert es jedenfalls

<html>
<head>
<title></title>
</head>
<script LANGUAGE="JavaScript">
<!--
function init(){
   stest = new Image();stest.src = "images/chat0.jpg";
   if (document.layers) {
      document.layers.testlay.document.open();
      document.layers.testlay.document.write('<a href="javascript:testfunc(0)"><IMG SRC=" + stest.src + " NAME="test_img" HEIGHT=60 WIDTH=90></a>');
      document.layers.testlay.top  = 100;
      document.layers.testlay.left  = 100;
      document.layers.testlay.document.close();  
   } else if (document.all) {
      document.all.testlay.innerHTML = '<IMG SRC="'+stest.src+'" NAME="test_img" HEIGHT=60 WIDTH=90>';
      with (testlay.style) {
         left =100;top =100;
      }  
   }  
}

function testfunc (x){
   alert(x);
}
//-->
</script>

<body onload="init()">
<DIV id="testlay" style="position:absolute; left:0; top:200; z-index:0;" onclick="testfunc(0)"></DIV>
</body></html>

Gruesse
Wilhelm