Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Javascript on application.cfm

Status
Not open for further replies.

Lotruth

Programmer
May 2, 2001
133
US
I am trying to use a javascript top menu on each page using application.cfm. It works fine in the pages that are in the folder, but when I try it in subfolders it doesn't. The application page is being accessed by the subfolder pages because test text shows up even though the javascript doesn't. Here's the script i'm using...

<html>
<head>
<title></title>
<style>
all.clsMenuItemNS, .clsMenuItemIE{text-decoration: none; font: bold 12px Arial; color: white; cursor: hand; z-index:100}
#MainTable A:hover {color: yellow;}
</style>

<script language="JavaScript">

//Top Nav Bar I v2.1- By Constantin Kuznetsov Jr.
//Modified by Dynamic Drive for various improvements
//Visit for this script

var keepstatic=1 //specify whether menu should stay static (works only in IE4+)
var menucolor="#000000" //specify menu color
var submenuwidth=150 //specify sub menus' width

</script>
</head>
<body>
<script language="JavaScript" src="menu.js"></script>
<script language="JavaScript" src="menucontext.js"></script>
<script language="JavaScript">
showToolbar();
</script>
<script language="JavaScript">
function UpdateIt(){
if (ie&&keepstatic&&!opr6)
document.all["MainTable"].style.top = document.body.scrollTop;
setTimeout("UpdateIt()", 200);
}
UpdateIt();
</script>

<br>test
</body>
</html>
 
without knowing why it doesn't work in subfolders, i would like to point out that application.cfm is not meant for using HTML or Javascript. I would suggest putting this in a separate file and cfincluding it on each page.
 
NorthStar is right.
however your problem is:
<script language="JavaScript" src="menu.js"></script>
<script language="JavaScript" src="menucontext.js"></script>
you'd have to put these files in every sub folder to keep the path valid.

Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.
-Douglas Adams (1952-2001)
 
Thanks you two. Do you mean put the...

<script language="JavaScript" src="menu.js"></script>
<script language="JavaScript" src="menucontext.js"></script>

tags on every page or put the js files in every folder?
 
files in every folder

Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.
-Douglas Adams (1952-2001)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top