JavaScript.CoolDev.Com Support Forums

Any questions related to JavaScript menu and JavaScript tree menu by Javascript.CoolDev.Com

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

adding coolmenu to page

 
Post new topic   Reply to topic    JavaScript.CoolDev.Com Forum Index -> COOLjsMenu
Author Message
MikeH
Guest





PostPosted: Tue Sep 16, 2003 3:49 am    Post subject: adding coolmenu to page Reply with quote

Hi, I'm having similar problems to Wakey (June 30 2003 post). I've followed the directions in that thread but am still having no luck (can see no menu on the page). My code is detailed below:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" src="/COOLjsMenu/js/coolmenu.js"></script>
<script language="JavaScript" src="/COOLjsMenu/js/menuitems.js"></script>
<style>
.clsCMOn {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
color: black;
font-size : 12px;
text-decoration : none;
padding : 4px 4px 4px 4px;
}
.clsCMOver
{
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
color: white;
font-size : 12px;
font-weight:bold;
text-decoration : none;
padding : 4px 4px 4px 4px;
}
</style>
</head>
<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>
<script language="JavaScript" src="/COOLjsMenu/js/coolmenu.js">
var menu = new COOLjsMenu("MainMenu", MENU_ITEMS);
</script>
</body>
</html>


If I use the suggested code for calling the COOLjsMenu function:

<script language="JavaScript"">
var menu = new COOLjsMenu("MainMenu", MENU_ITEMS);
</script>

then I get a script error saying that the COOLjsMenu function cannot be found (also is the extra double quote just a typo or should it be there?)

I am using the evaluation version, not the production one. I have put the blank image file in the menuitmes.js file and have made sure that all paths to files are correct.

Any help greatly appreciated.

Cheers, MikeH Sad
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Wed Sep 24, 2003 11:46 am    Post subject: Reply with quote

Double quote was inserted by accident, but it does not matter since most browsers just skip it. Message "COOLjsMenu is undefined" means that coolmenu.js was not included correctly. As I can see you have absolute reference to that file - please check if it really exists in the root folder on your webserver or local drive - whereever you are trying to get the script working.
Actually, that error with missing COOLjsMenu is covered in the FAQ (http://javascript.cooldev.com/testdoc/faq/merged.html)...
Back to top
DamBuster



Joined: 20 Jan 2008
Posts: 3

PostPosted: Sun Jan 20, 2008 10:04 am    Post subject: I have the same problem Reply with quote

I have the same problem except everything is working with Firefox and Safari, which means my paths are correct.

Does anyone know how to make CooljsMenu display itself in Internet Explorer.

Its a great piece of JS but it is driving me nuts. I have a week to sort it out. If I can't, I will turn to a different solution ;-(

Thanks to anyone reading this,

DamBuster
Back to top
DamBuster



Joined: 20 Jan 2008
Posts: 3

PostPosted: Sun Jan 20, 2008 10:20 am    Post subject: CooljsMenu in IE glitch Reply with quote

The actual error message that IE displays is as follows:

Line 21: expected identifier, string or number


Here's the code on line 21:

<script type="text/javascript" language="JavaScript">var m1 = new COOLjsMenu("menu1", MENU_ITEMS)</script>

I also tried adding a semicolon, but to no avail. However, BOTH lines of code work excellently under Firefox and Safari.

Hope this helps,

DamBuster
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Wed Mar 05, 2008 9:49 am    Post subject: Reply with quote

IE has more strict understanding of JavaScript (yes, in some cases it sticks to the standard more closely than Firefox, Safari etc.). One such case is the following:
Code:
{ a:1, b:2, }

Standard does not allow that last comma, and IE obeys it. But other browsers do not. Probably, your menuitems.js has this kind of incompatibility, and it throws some errors, leaving MENU_ITEMS undefined. Then IE tries to interpret next chunk, and then you see one more error - undefined MENU_ITEMS.
Back to top
tranceport185



Joined: 29 Apr 2008
Posts: 2

PostPosted: Tue Apr 29, 2008 1:26 pm    Post subject: Reply with quote

AlexKunin wrote:
IE has more strict understanding of JavaScript (yes, in some cases it sticks to the standard more closely than Firefox, Safari etc.). One such case is the following:
Code:
{ a:1, b:2, }

Standard does not allow that last comma, and IE obeys it. But other browsers do not. Probably, your menuitems.js has this kind of incompatibility, and it throws some errors, leaving MENU_ITEMS undefined. Then IE tries to interpret next chunk, and then you see one more error - undefined MENU_ITEMS.


I wonder if this is my problem so if I was to upgrade this would not be an issue?
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Tue Apr 29, 2008 4:06 pm    Post subject: Reply with quote

Upgrade what? Every possible visitor's browser? Just remove that spare comma, and the problem will be solved.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    JavaScript.CoolDev.Com Forum Index -> COOLjsMenu All times are GMT
Page 1 of 1