I came across a cool chunck of javascript to sort tables: http://www.kryogenix.org/code/browser/sorttable/
and I'm trying to incorporate into some of my stuff. But I've never really done anything with Javascript (and am not a big web/html guy to begin with) and it's giving me problems.
I am attempting to include the javascript file with the following statement in the head section of my page:
<script type="text/javascript" src="sorttable.js"></script>
I don't think it's relavent, but the page is generated via a perl script and the line above is generated with the follow9ing print statement:
print '<script type="text/javascript" src="sorttable.js"></script>';
When I load the page, it doesn't work as expected and on checking the server error log I find the following:
[Thu Mar 09 11:31:54 2006] [error] syntax error at /srv/www/cgi-bin/sorttable.js line 5, near ") {"\nBareword found where operator expected at /srv/www/cgi-bin/sorttable.js line 6, near "// Find"\nsyntax error at /srv/www/cgi-bin/sorttable.js line 10, near "tbls["\nBareword found where operator expected at /srv/www/cgi-bin/sorttable.js line 12, near "//initTable"\nsyntax error at /srv/www/cgi-bin/sorttable.js line 12, near "//initTable"\nsyntax error at /srv/www/cgi-bin/sorttable.js line 18, near ") {"\n
Here are the first 30 lines of the sorttable.js file. Any ideas??
 
FWIW, the server is Apache2 on SuSe
			
			and I'm trying to incorporate into some of my stuff. But I've never really done anything with Javascript (and am not a big web/html guy to begin with) and it's giving me problems.
I am attempting to include the javascript file with the following statement in the head section of my page:
<script type="text/javascript" src="sorttable.js"></script>
I don't think it's relavent, but the page is generated via a perl script and the line above is generated with the follow9ing print statement:
print '<script type="text/javascript" src="sorttable.js"></script>';
When I load the page, it doesn't work as expected and on checking the server error log I find the following:
[Thu Mar 09 11:31:54 2006] [error] syntax error at /srv/www/cgi-bin/sorttable.js line 5, near ") {"\nBareword found where operator expected at /srv/www/cgi-bin/sorttable.js line 6, near "// Find"\nsyntax error at /srv/www/cgi-bin/sorttable.js line 10, near "tbls["\nBareword found where operator expected at /srv/www/cgi-bin/sorttable.js line 12, near "//initTable"\nsyntax error at /srv/www/cgi-bin/sorttable.js line 12, near "//initTable"\nsyntax error at /srv/www/cgi-bin/sorttable.js line 18, near ") {"\n
Here are the first 30 lines of the sorttable.js file. Any ideas??
FWIW, the server is Apache2 on SuSe
 
				
		 
			 
 
		 
 
		 
 
		 
 
		 
 
		
 Facebook
Facebook Twitter
Twitter