Gossamer Forum
Home : Products : DBMan : Customization :

JavaScript SRC

Quote Reply
JavaScript SRC
Hello,

I'm trying to call a javascript from DBman and for some reason it is not working. I'm calling a file using <SCRIPT LANGUAGE="JavaScript1.2" SRC="../javascript/menu.js"></SCRIPT> within a print statement. Whenever I call the script URL, the browser goes to the javascript URL and causes a Server 500 error. Why is DBMan following the JavaScript URL and how can I prevent this?
Quote Reply
Re: JavaScript SRC In reply to
One problem could be the location where you are referencing the .js file. Since you have your db.cgi file in your cgi-bin directory, using "../" will not give the proper location of your javascript file.

Try this:

Code:
<SCRIPT LANGUAGE="JavaScript1.2"
SRC="/javascript/menu.js">

This should reference your javascript appropriately. You can also try to put in the whole virtual path to your .js file, such as:

Code:
<SCRIPT LANGUAGE="JavaScript1.2" SRC="http://www.myserver.com/javascript/menu.js">

If you are still having problems, then you might want to try to insert the whole javascript between the <head></head> anchors.

I have installed javascripts in my DBMAN files and they are working fine.

Hope this helps.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited August 18, 1999).]
Quote Reply
Re: JavaScript SRC In reply to
If I'm not mistaken, I don't think you can call an external file from within a print statement. Here's a thread that might help:

http://www.gossamer-threads.com/...um8/HTML/000601.html

I don't see any reason why a JS include would be any different.

Dan
Quote Reply
Re: JavaScript SRC In reply to
The difference is that SSI Includes executes a server side file versus a java script, which is a client side file. I have inserted different kinds of javascripts in perl files and they have worked. (With using the external .js file.)

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us