Hallo Alex,
function write(){
1. Es ist ungünstig, eine Funktion write zu nennen, da dies ein reservierter Name ist. Das ist aber nicht der Fehler.
document.write("<a href='#' onclick='javascript:test()'>Testlink</a>");
2. javascript: hat in einem Eventhandler nichts verloren. Das ist aber auch nicht der Fehler.
<body onload="write()">
3. Damit wird das Dokument neu geschrieben und sieht dann so aus:
<a href='#' onclick='javascript:test()'>Testlink</a>
Sonst steht nichts mehr darin, also auch nicht die Funktion test().
_Hier_ ist der Fehler.
Grüße
Andreas
--
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
(Rich Cook)
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
(Rich Cook)