I am trying to start an instance of DataTables with the following code ...
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() {
$('#example').DataTable();
} );
</script>
But when I access the HTML through a web browser, the browser displays the message "Deactivate SyntaxError: Unexpected number" , and here is the source code from the browser ...
<script type="text/javascript" language="javascript" class="init">
0 11 4 3 2 1 0document).ready(function() {
0 11 4 3 2 1 0'#example').DataTable();
} );
</script>
As you can see, some instructions have been replaced by the numbers "0 11 4 3 2 1", and I do not know what causes it.
jQuery is src from Google and javascript DataTables from their CDN.
I am creating HTML from a Perl script using CGI, printing the Content-type: text / html header and using different! DOCTYPE ... but still nothing. Code editing does not display hidden characters.
Your help would be greatly appreciated.
Best, e.
EDIT: this is Perl code creating HTML ...
use Switch;
use CGI qw/:standard/;
use CGI::Carp 'fatalsToBrowser';
print "Content-type:text/html\r\n\r\n";
print qq{<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
<link rel="stylesheet" type="text/css" href="css/jquery.dataTables.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script language="JavaScript" type="text/javascript" src="js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript">
/* <![CDATA[ */
$(document).ready(function() {
$('#example').DataTable();
} );
/* ]]> */
</script>
</head>};