|
-
Nov 12th, 2005, 08:34 AM
#1
Thread Starter
Member
Perl calls Javascript
i have a small java script menu i wish to display at the top of some web pages
the code used is:
Code:
<html>
<head>
<title>Tigra Menu Test</title>
<script language="JavaScript" src="menu.js"></script>
<script language="JavaScript" src="menu_items.js"></script>
<script language="JavaScript" src="menu_tpl.js"></script>
<link rel="stylesheet" href="menu.css">
</head>
<body>
<script language="JavaScript">
new menu (MENU_ITEMS, MENU_TPL);
</script>
</body>
</html>
at the minute im just trying to get the damn thing to display in my perl file i have:
Code:
#! c:/perl/bin/perl
use CGI ':standard';
print "Content-type: text/html\n\n";
print <<FOO;
<html>
<head>
<title>Tigra Menu Test</title>
<script language="JavaScript" src="menu.js"></script>
<script language="JavaScript" src="menu_items.js"></script>
<script language="JavaScript" src="menu_tpl.js"></script>
<link rel="stylesheet" href="menu.css">
</head>
<body>
<script language="JavaScript">
new menu (MENU_ITEMS, MENU_TPL);
</script>
TEST TEXT
</body>
</html>
FOO
it is compiling okay and displaying the "TEST TEXT" part when i view the source the info on the java script is displayed:
PAge source:
Code:
<html>
<head>
<title>Tigra Menu Test</title>
<script language="JavaScript" src="menu.js"></script>
<script language="JavaScript" src="menu_items.js"></script>
<script language="JavaScript" src="menu_tpl.js"></script>
<link rel="stylesheet" href="menu.css">
</head>
<body>
<script language="JavaScript">
new menu (MENU_ITEMS, MENU_TPL);
</script>
assssssssasddddddddddddddddddddddasdasd
</body>
</html>
now the javascript menu makes use of a few other files that need to be in the same directory, i have placed these in the htdocs and the cgi-bin thinking that the menu is not displaying as these cant be found but its still not working
Thanks
Antonio
-
Nov 12th, 2005, 10:40 AM
#2
Re: Perl calls Javascript
I'm not very experienced with CGI/Perl, but I do know that the cgi-bin folder is protected. You should move the files being used to another directory, and change the reference paths in your javascript files.
-
Nov 12th, 2005, 11:45 AM
#3
Fanatic Member
Re: Perl calls Javascript
I try mendhak's suggestion...move the source file to the base directory where your normall html stuff is and change the paths to "./menu.js"
Oh, actually the cgi-bin isn't protected as such but the server does consider everything in it to be an executable. Therfore instead of serving the file contents the server attempts to execute the file. A perl script can be named virtually anything and if it's in the cgi-bin (a cgi-bin doesn't actually have to be name cgi-bin either, btw) it will execute when called.
What bug? That's not a bug. It's an undocumented feature!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|