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 

Driving myself batty

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



Joined: 16 Jul 2003
Posts: 2

PostPosted: Wed Jul 16, 2003 1:13 am    Post subject: Driving myself batty Reply with quote

I'm evaluating this script. If it works, and if I can get it to do what I need, I will be buying the Pro version. But....so far I'm about ready to scream

I'm trying to add subitems, and frankly I can't see where I've done anything wrong.

In IE, the error says: (line 82 - which is the line refering to Private Parties)
"Expected ')'"

Whereas using the Javascript console in NS 7.0, I get:

Error: missing ) in parenthetical
Source File: file:///C:/WINDOWS/Desktop/My%20Stuff/Clients/Logan%20Site/Site/misc/menuitems.js
Line: 81, Column: 10
Source Code:
(code:"Corporate Retreats", "format":("style":STYLE_BACKGROUND2_5)),

Here's the code:

Code:
{code:"Events", url:"http://www.grandeurenterprises.com/events.shtml", "format":{"leveloff":[10,175]},
      sub:[
         {"itemoff":[24,0]},
         {code:"Private Events", "format":{"style":STYLE_BACKGROUND2_1},
               sub:[
               {"itemoff":[24,0]},
               {code:"Members Only", "format":{"style":STYLE_BACKGROUND2_1}},
               {code:"LARP", "format":{"style":STYLE_BACKGROUND2_2}},
               {code:"SCA", "format":{"style":STYLE_BACKGROUND2_3}},
               {code:"Weddings", "format":{"style":STYLE_BACKGROUND2_4}},
               (code:"Corporate Retreats", "format":("style":STYLE_BACKGROUND2_5)),
               (code:"Private Parties", "format":("style":STYLE_BACKGROUND2_6))
               ]
            }
        ]
         },


I've tried it without this level, so I know everything but this level works.

I've also added the following to the variables:

Code:

var background5_color = {"border":"#666666", "shadow":"#DBD8D1", "bgON":"#E0E080","bgOVER":"#FFFFC0"};
var background6_color = {"border":"#666666", "shadow":"#DBD8D1", "bgON":"#E0E080","bgOVER":"#FFFFC0"};

var STYLE_BACKGROUND5 = {"border":1, "shadow":2, "color":background5_color, "css":top_css};
var STYLE_BACKGROUND6 = {"border":1, "shadow":2, "color":background6_color, "css":top_css};

var background5_css = {"ON":"clsCMBackground5On", "OVER":"clsCMBackground5Over"};
var background6_css = {"ON":"clsCMBackground6On", "OVER":"clsCMBackground6Over"};

var STYLE_BACKGROUND2_5 = {"border":1, "shadow":2, "color":color, "css":background5_css};
var STYLE_BACKGROUND2_6 = {"border":1, "shadow":2, "color":color, "css":background6_css};
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Wed Jul 16, 2003 9:16 pm    Post subject: Reply with quote

Don't scream, but take a closer look at your menuitems.js: you are using round brakets where curly are expected. These lines:
Code:
(code:"Corporate Retreats", "format":("style":STYLE_BACKGROUND2_5)),
(code:"Private Parties", "format":("style":STYLE_BACKGROUND2_6))

actually must look like this:
Code:
{code:"Corporate Retreats", "format":{"style":STYLE_BACKGROUND2_5}},
{code:"Private Parties", "format":{"style":STYLE_BACKGROUND2_6}}

Curly braces hold object definition, and inside them there must be pairs of values: pairs a separated by commas, and values in every pair are separated by a colon. Square brakets hold arrays, and elements must be separated with commas. And round brakets do not hold any special things, and this is incorrect to have a colon inside round brakets. IE was talking about this in its error message, and NN also did.
Back to top
cmwagner



Joined: 16 Jul 2003
Posts: 2

PostPosted: Wed Jul 16, 2003 9:44 pm    Post subject: Thank you Reply with quote

I didn't notice that those were curly braces when I typed in the changes - I must have been overtired. Embarassed

Thank you for pointing this issue out. This, plus one or two other things that were incorrectly closed (I got too happy with the closing braces), have fixed the issue I was having.

Now, if the client likes what has developed - we certainly will be passing along licensing $$. Wink
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