Hi Monks i have a simple implementation using HTML PERL AND JAVASCRIPT , runing with xampp apache web server , the code are the following:

HTML PART

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>THIS IS A PERL SCRIPT TEST</h1>
<p>WE WILL EXECUTE PERL SCRIPT</p>
<br>
<a href="http://localhost/cgi-bin/prueba3.cgi">
EXECUTESCRIPT</a>
</body>
</html>

prueba.cgi

#!"C:\xampp\perl\bin\perl.exe"
use strict;
use warnings;
use CGI qw{ :standard };
use CGI::Carp qw{ fatalsToBrowser };
print "Content-type: text/html\n\n";
print"<head>";
print "<title>PERL</title>";
print qq{<script src="basico.js">};
print "</script>";
print"</head>";
print "<body>\n";
print "<h1>READY TO TEST A JAVASCRIPT FROM
PERL</h1>";
print "<p>THE SCRIPT IS:</p>";
print qq{<input type="button" onclick="popup()"
value="EXECUTE SCRIPT!">};
print"</body>\n";
print"</html>";

basico.js

function popup() {
alert("a javascript is running")}

When its runing and click in the EXECUTE SCRIPT! button to call javascript , the browser doesnt respond, using the developer browser tools i can read the message: Failed to load resource: the server responded with a status of 500 (Internal Server Error), could anyone help me? thanks a lot


In reply to PERL CGI HTML JAVASCRIPT APACHE PROBLEM by MONKTROOPER

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.