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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JavaScript Include Question/Prob

Status
Not open for further replies.

Fitzer72

Programmer
Apr 27, 2004
4
US
Hi,
I have a banner & menu (designed in Fireworks). The menu items are drop down menus and 1 of these menu items has a submenu.
When I have the javascript code included in the html file, the menus come up fine. If I create a separate JS file and put all my functions in there, the menus/banners come up fine except: When I bring up the first drop down menu, I can see a small X where the sub menus begin.
This code does not work:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script language="JavaScript" src="../Banners/submenu.js"></script>
<script language="JavaScript1.2" src="../Banners/mm_menu.js"></script>
</head>
<body>
<script language="JavaScript1.2">mmLoadMenus();</script>
---
--
</body>
my submenu.js looks something like this:
// Start JS
<!--
function mmLoadMenus() {
// do menu stuff
} // mmLoadMenus()

//-->
// End JS

If I take the function and put it back into the html code to:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script language="JavaScript">
function mmLoadMenus() {
// do menu stuff
} // mmLoadMenus()
</script>
<script language="JavaScript1.2" src="../Banners/mm_menu.js"></script>
</head>

...it works ok. Any suggestions. Are there paths messed up when I move the function to a separate file and this is the reason why i'm getting those little x's at the start of the submenu? Appreciate any help. I'm going batty lookin at this thing! Just to claify, I can see the x's even before I select the menu item that has another submenu.
Fitzer72
 
Wouldn't you know it. As soon as I posted my last thread, it came out ok. Browser issue or just me being an idiot!
Thx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top