timothy: +(PERL) JavaScript via CGI-Script dynamisch generieren

Beitrag lesen

Ausprobiert hab ich's jetzt nicht ... aber

es funzt !!!

test.pl

#!perl.exe

print "Content-type: text/javascript\n\n";
print <<"EOT";
      function doit()
      {
         alert("Hello World");
      }
EOT

test.html

<html>
<head>
<title>Untitled</title>
    
<script language="JavaScript" src="http://localhost/autoselfhtml/test.pl">          
</script>
</head>

<body>
<button name="but" onClick="doit()">Do it !!!</button>
</body>
</html>

Bye
Timothy

P.S. nur so als Schnellschuß!!!