perl cgi jquery not working
perl cgi jquery not working
所以我做了2个测试页面,一个在perl cgi和另一个在html中,测试出jquery脚本,但令人惊讶的是,只有html的一个工作。我需要在perl cgi中做,所以我不知道是什么问题。
#!/usr/bin/perl
use CGI;
my $query = new CGI;
print "Content-type: text/html'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>
<script type="text/javascript" src="tablesorter/jquery-latest.js"></script>
<script type="text/javascript" src="tablesorter/jquery.tablesorter.js"></script>
<script type="text/javascript">
jQuery(document).ready(function()
{
jQuery("#myTable").tablesorter();
}
);
</script>
</head>
<body>
<table id="myTable" class="tablesorter">
<thead>
<tr>
<th>Last Name</th>
<th>First Name</th>
<th>Email</th>
<th>Due</th>
<th>Web Site</th>
</tr>
</thead>
<tbody>
<tr>
<td>Smith</td>
<td>John</td>
<td>jsmith@gmail.com</td>
<td>'$50.00</td>
<td>http://www.jsmith.com</td>
</tr>
<tr>
<td>Bach</td>
<td>Frank</td>
<td>fbach@yahoo.com</td>
<td>'$50.00</td>
<td>http://www.frank.com</td>
</tr>
<tr>
<td>Doe</td>
<td>Jason</td>
<td>jdoe@hotmail.com</td>
<td>'$100.00</td>
<td>http://www.jdoe.com</td>
</tr>
<tr>
<td>Conway</td>
<td>Tim</td>
<td>tconway@earthlink.net</td>
<td>'$50.00</td>
<td>http://www.timconway.com</td>
</tr>
</tbody>
</table>
</body>
</html>
);
从浏览器的角度来看,CGI脚本的输出与静态HTML页面完全相同。因此,如果您的Perl脚本正在工作并输出与HTML页面完全相同的内容,那么它的工作方式将完全相同。
在运行CGI脚本后,当在浏览器中查看源代码时会发生什么?查看非工作版本和工作版本之间的差异。
(如果您是新手:如果您在浏览器中看到Perl代码,这意味着您的服务器没有正确设置,并且您根本没有执行CGI。)
用反斜杠转义$ it,因为$(在Perl中被认为是一个变量
相关文章:
- $rootScope not working
- jQuery document.ready not working
- Javascript getElementsByTagName not working?
- JQuery.val( ) not working
- Tomcat websocket is not working
- Javascript JSON.parse not working
- NodeJS Multer is not working
- Regex not working
- Ember run.debounce not working
- AngularJs 1 not working
- document.getElementById.style.backgroundImage not working
- Rxjs5, distinct() is not working
- createOscillator noteOn not working
- Javascript - .getHours() not working
- Javascript setTimeout not working | onkeydown
- MongoDB $pull not working
- Express router.use not working
- JSONP not working
- window.opener not working in chrome & IE
- Backbone + RequireJS: Collection.each() is not working