Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:23

menu will NOT render propperly


Poster: ACIDSTEALTH
Dated: Wednesday June 16 2004 - 5:01:46 BST

I have been trying at this for 9 hours and have been unable to get the menu to render propperly. it gives me a syntax error all the time.

syntax error line 65 character 36????

A friend said he found in error in the code but he was being an ass, wouldn't tell me what it was.

http://nationsafugnoff.fateback.com/menu_data.js
http://nationsafugnoff.fateback.com/Pro ... Layout.htm

And I cannot figure out whats wrong because I have no prior experiance with javascript.

Basically I need the menu to render in the center below the top banner down 100 pixils exactly. That pageis on my old website FTP which has forced adds, but the new site doesn't have adds on it, so it will look right when uploaded to the new server.
new site __at__ nationsafungoff.no-ip.com/

Also, here is the link to a zip file I uploaded to another forum, but didn't get enough help to solve the problem there.
http://www.auniverse.net/anime/msg/inde ... t&id=74048
it has everything in it.

Anyways, help would be appriciated alot, thanks. :)

BTW, for the first two links,, you have to right click "save target as..." otherwise it is a 403 restricted


Poster: Maz
Dated: Wednesday June 16 2004 - 5:37:40 BST

That's version 3 of the menu.

You should try version 5.

maz


Poster: John
Dated: Wednesday June 16 2004 - 5:47:14 BST

Maz is, of course, correct.

To be just a little more complete, v3 is no longer supported or developed. You can get v5 at http://milonic.com/.


Poster: kevin3442
Dated: Wednesday June 16 2004 - 6:55:43 BST

Hi All,

Actually... it's mostly v5, but part v3. It's got all three v5.22 source .js files. the menu_data.js file, however, is another story; it's a hybrid. It starts with comments from a typical v3 menu_array.js file, followed by an initial line of code from a v3 menu_array.js file (v3.5.14 or later). This is followed by correct v5 global variable settings, and then a correct v5 menu style definition. Then come the menu definitions. Each one starts out correctly for v5. But the item definitions are an odd mix of v3 item definition syntax within v5 aI() function calls. It's the last bit that's causing the error message: line 64 is where the first aI() call appears.

So... ACIDSTEALTH... what to do?

It looks like much of your menu_data.js file is OK, but you'll have to remove some of it, and change all of the aI() item definitions to use the correct syntax.

I'm assuming that you downloaded the menu code from the main site, then unzipped the file to get milonic_src.js, mmenudom.js, and mmenuns4.js. In that zip file, you will also see an example menu_data.js file showing the correct file structure (note how it starts) and the correct aI() item definition syntax. Here's something to get you started:

(1) Delete the first 25 lines of menu_data.js; it's all version 3 stuff.

(2) Your menu definitions start out fine, but the stuff inside of each aI() funciton call (the stuff between the parentheses) is all messed up. Look at the example menu_data.js file to see how menu items are defined with
aI(). You have your old v3 lines inside of the aI(). Won't work. So, instead of the v3 approach:
Code:
,"Item Text", "URL", "Alternate URL", "Status Text", "Separator Bar"

You'd have the v5 approach:
Code:
aI("text=Item Text;url=whatever.htm;status=Status Text;");

The separator bar is often defined in the menuStyle, or can also be defined for each item, but that's more advanced so let's stick to the basic for now.

To take some examples from your code:

(a) In your Main Menu, the "Home" item is an example of an item that just links to a different page. In v3 it would have been something like
Code:
," Home ","/index.htm",,"Home",1

In v5 that would be
Code:
aI(" Home url=/index.htm;status=Home;");
(you could probably drop the nonbreaking spaces for padding here; they're not needed quite so much in v5).

(b) Let's use the "Gallery" item in your Main Menu as an example of a menu
item that just opens a submenu (no link of its own). In v3 it would have been something like
Code:
," Gallery ","show-menu=Gallery",,"",1

In v5 it would be
Code:
aI("text=Gallery;showmenu=Gallery;");
Note that there is no longer a dash in showmenu.

(c) Finally, I don't know if you have any, but there can also be menu items that both link to a url if clicked and open a submenu when moused over. In v3, that would have been something like this:
Code:
,"Web Search","show-menu=Search","http://www.google.com/","Click to go to directly to Google",1

So, mousing over the item sould open a submenu called "Search" but clicking the item would go to Google (the "alternate URL" in v3 terminology)
In v5, that'd be
Code:
aI("text=Web Search;showmenu=Search;url=http://www.google.com/;status=Click to go directly to Google;");


Final note: If you've tried to manually go from a v3 menu_array.js file to a v5 menu_data.js file, you might try the v3 to v5 converter on the main site. I haven't tried it myself, but I hear that it works pretty well as a starting point, with perhaps a small amount of editing left to be done to the converted file. Ccut and paste from your v3 menu_array.js file into your v5 menu_data.js file also shouldn't be too difficult.

Come back if you have questions... and you don't have to wait nine hours!

Cheers,

Kevin

P.S. My guess is that your friend wouldn't tell you what the error was because he had no idea what it was. I don't see how he could have unless he was very familiar with v3 and v5 of Milonic Menus. ;)

P.P.S. This post was moved to the v3 forum because of the v3 content in the code. But I'm moving it back to the v5 forum, because it looks like it was your intent to use v5 and that's the direction you're heading.


Poster: Maz
Dated: Wednesday June 16 2004 - 7:55:26 BST

I wasn't sure but it was a hybrid 8)

Had trouble accessing the site.

maz


Poster: John
Dated: Wednesday June 16 2004 - 18:26:21 BST

Maz wrote:
Had trouble accessing the site.

So did I, but when I finally saw the v3 header stuff I just stopped there.

A suggestion here would be to read http://milonic.com/forum/viewtopic.php?t=2981.


Poster: ACIDSTEALTH
Dated: Wednesday June 16 2004 - 20:38:03 BST

Ok, so I edited it like you said and saved it to my server and I am still getting an error. Syntax error: line 49 character 1?
I already grabbed the latest v5 sript files that go with it and uploaded them then I basically cut out the first 25 lines of code like you said and edited the value strings to v5 coding and just cut/paste the values in and saved it to the server and it doesn't seem to be working.
Code:
_menuCloseDelay=500           // The time delay for menus to remain visible on mouse out
_menuOpenDelay=150            // The time delay before menus open on mouse over
_subOffsetTop=10              // Sub menu top offset
_subOffsetLeft=-10            // Sub menu left offset



with(menuStyle=new mm_style()){
align="center"
onbgcolor="#666666";
oncolor="#0066FF";
offbgcolor="#000000";
offcolor="#003399";
bordercolor="#333333";
borderstyle="solid";
borderwidth=1;
separatorcolor="#333333";
separatorsize="1";
padding=1;
fontsize="75%";
fontstyle="normal";
fontfamily="Ariel, Times New Roman, Verdana";
pagecolor="black";
pagebgcolor="#000000";
headercolor="#000000";
headerbgcolor="#ffffff";
subimage="";
subimagepadding="2";
overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color='#000000', Direction=135, Strength=5)";
outfilter="randomdissolve(duration=0.3)";
}

with(milonic=new menuname("Main Menu")){
style=menuStyle;
top=100;
left=10;
alwaysvisible=1;
orientation="horizontal";
aI(" Home url=/index.htm;status=Home;");
aI("text=Gallery;showmenu=Gallery;");
aI("text=Riragh;showmenu=Riragh;");
aI("text=Reviews;showmenu=Reviews;");
aI("text=Fandom;showmenu=Fandom;");
aI("text=Downloads;showmenu=Downloads;");
aI("text=Saudec;showmenu=Saudec;");
aI("text=Other;showmenu=Other;");
aI("text=Contact;showmenu=Contact;");
)

with(milonic=new menuname("Gallery")){
style=menuStyle;
overflow="scroll";
aI("text=Seikai no Danshou;url=/SND.htm;status=NationSafugnoff > Gallery > Lost Chapter of the Stars;");
aI("text=Seikai no Monshou;url=/snm-main.htm;status=NationSafugnoff > Gallery > Crest of the Stars;");
aI("text=Seikai no Senki;url=/sns-main.htm;status=NationSafugnoff > Gallery > Banner of the Stars;");
aI("text=Seikai no Senki II;url=/sns2-main.htm;status=NationSafugnoff > Gallery > Banner of the Stars II;");
)
   
with(milonic=new menuname("Riragh")){
style=menuStyle;
overflow="scroll";
aI("text=Bar Frybarec;url=/Empire.htm;status=NationSafugnoff > Information > Bar Frybarec;");
aI("text=Bar Frybarec History;url=/history.htm;status=NationSafugnoff > Information > Bar Frybarec History;");
aI("text=Lubarec;url=/Navy.htm;status=NationSafugnoff > Information > Lubarec;");
aI("text=Abh Culture;url=/culture.htm;status=NationSafugnoff > Information > Abh Culture;");
aI("text=<i>Nation Sfagnaumh</i>;url=;status=NationSafugnoff > Information > Nation Sfagnaumh the Planet;");
aI("text=Abh Profiles;url=/Abh.htm;status=NationSafugnoff > Information > Abh Character Profiles;");
aI("text=Terran Profiles;url=/Terran.htm;status=NationSafugnoff > Information > Terran Character Profiles;");
aI("text=<i>Hiroyuki Morioka</i>;url=;status=NationSafugnoff > Information > Hiroyuki Morioka;");
aI("text=Baronh;url=/Baronh.htm;status=NationSafugnoff > Information > Baronh;");
aI("text=Abh Math;url=/measurments.htm;status=NationSafugnoff > Information > Abh System of Measurments;");
aI("text=Impierial Anthem;url=/anthem.htm;status=NationSafugnoff > Information > Imperial Anthem;");
aI("text=Interstellar Nations;url=/4nations.htm;status=NationSafugnoff > Information > Interstellar Nations;");
)
   
with(milonic=new menuname("Reviews")){
style=menuStyle;
overflow="scroll";
aI("text=<i>Seikai no Danshou</i>;url=;status=NationSafugnoff > Reviews > Lost Chapter of the Stars;");
aI("text=Seikai no Monshou;url=/COTS.htm;status=NationSafugnoff > Reviews > Crest of the Stars;");
aI("text=<i>Seikai no Senki</i>;url=;status=NationSafugnoff > Reviews > Banner of the Stars;");
aI("text=<i>Seikai no Senki II</i>;url=;status=NationSafugnoff > Reviews > Banner of the Stars II;");
)
   
with(milonic=new menuname("Fandom")){
style=menuStyle;
overflow="scroll";
aI("text=Fan Art;url=/fanart.htm;status=NationSafugnoff > Fandom > Fan Art;");
aI("text=Fan Fiction;url=/fanfiction.htm;status=NationSafugnoff > Fandom > Fan Fiction;");
)
   
with(milonic=new menuname("Downloads")){
style=menuStyle;
overflow="scroll";
aI("text=Downloads Page;url=/Seikaidownloads.htm;status=NationSafugnoff > Downloads;");
aI("text=IRC Help;url=/IRC.htm;status=NationSafugnoff > IRC;");
)
   
with(milonic=new menuname("Saudec")){
style=menuStyle;
overflow="scroll";
aI("text=Seikai Saudec;url=/SAUDeK.htm;status=NationSafugnoff > Saudec;");
aI("text=Milonic;url=http://www.milonic.co.uk/;status=Milonic LTD (Menu Author Site);");
)
   
with(milonic=new menuname("Other")){
style=menuStyle;
overflow="scroll";
aI("text=Credits;url=/credits.htm;status=NationSafugnoff > Site Credits & Acknowledgements;");
aI("text=Copyright(C);url=/copyright.htm;status=NationSafugnoff > Copyright Notice;");
aI("text=Updates;url=/news.htm;status=NationSafugnoff > Site Updates;");
)

with(milonic=new menuname("Contact")){
style=menuStyle;
overflow="scroll";
aI("text=Contact Me;url=drbonnell __at__ frontiernet.net;status=NationSafugnoff > Contact > ***ACID STEALTH FIGHTER***;");
aI("text=About Me;url=/aboutme.htm;status=NationSafugnoff > Contact > About Me;");
)

drawMenus();


As for my friend not telling me, I'm somewhat sure he knows because he has a 4 year degree in programming in just about every language there is, C, C++, PERL, PHP, HTML, XML, Javascript, etc. He is just being an ass, LOL! :P


Poster: Maz
Dated: Wednesday June 16 2004 - 21:51:31 BST

I need a url and all I see is a frame, it sounds like the path might be a problem on the script in html, can you check its working correctly by seeing if your path comes up in the url?

Although i wonder if this > is causing a problem.

aI("text=Seikai no Danshou;url=/SND.htm;status=NationSafugnoff > Gallery > Lost Chapter of the Stars;");

maz


Poster: ACIDSTEALTH
Dated: Wednesday June 16 2004 - 22:18:29 BST

Maz wrote:
I need a url and all I see is a frame, it sounds like the path might be a problem on the script in html, can you check its working correctly by seeing if your path comes up in the url?

Although i wonder if this > is causing a problem.

aI("text=Seikai no Danshou;url=/SND.htm;status=NationSafugnoff > Gallery > Lost Chapter of the Stars;");

maz

What do you mean by checking the path? And seeing a frame? If you directly click on the link in my first post to the menu_data.js file, it wont appear because the server has some anti-hotlinking device installed on it so you have to "save target as" to get it.

And the ">" shouldn't be affecting it should it? Because AU (another forum) which is running the menu has those in there, then again, it is version 3 of the menu.


Poster: Maz
Dated: Wednesday June 16 2004 - 22:30:28 BST

Can you post the javascript tags you have in your html file for the menu, I'll see if that helps.

If its an Iframe thing someone else may have to help because I haven't tried working with those. Or double check the instructions for use in an Iframe.

I really don't know if the > make any difference :|

I'm a bit lost too trying to figure this out.

maz


Poster: kevin3442
Dated: Wednesday June 16 2004 - 22:39:46 BST

Hi,

Your error is indeed a js syntax error. Each menu definition begins with something like:
Code:
with(milonic=new menuname("Main Menu")){

Which you have done just fine. But each menu definition should end with a
Code:
}

... a closed curly brace, to match the open curly brace at the start of the menu definition. You have a closed parenthesis instead of a curly brace.

You'll note that the error, line 49, comes just after the end of your Main Menu; that's where the js interpreter is looking for the } and it doesn't find it. So, it should be an easy fix. Go through your menu_data code and replace the ) you have at the bottom of each menu definition with a }

Nice job on the cutting and pasting.

Hope that helps,

Kevin


Poster: Maz
Dated: Wednesday June 16 2004 - 23:12:38 BST

Darn I need stronger glasses 8O

maz


Poster: ACIDSTEALTH
Dated: Thursday June 17 2004 - 0:22:31 BST

Thx for telling :) I wouldn't of cought that myself :P

BTW, this is the code going right below the <body> tag of the test page
Code:
<SCRIPT language=JavaScript src="http://nationsafugnoff.fateback.com/milonic_src.js" type=text/javascript></SCRIPT>   
<script   language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=http://nationsafugnoff.fateback.com/mmenuns4.js><\/scr"+"ipt>");      
  else _d.write("<scr"+"ipt language=JavaScript src=http://nationsafugnoff.fateback.com/mmenudom.js><\/scr"+"ipt>");
</script>

<SCRIPT language=JavaScript src="http://nationsafugnoff.fateback.com/menu_data.js" type=text/javascript></SCRIPT>   


When I upload the final I will be removing the URL and just leaving "filename.js" there or "filename.js"

OK, so I fixed that error and another error came up.
Line 17
character 3922
error " '_si" undefined

And I think it was Maz asked me a question about Ifram, It isn't in an I-frame, but there is an I-frame on that paticular page. If the I-frame is affecting it I could remove that, might even look better that way. But I already removed itonce and it didn't seem to have any effect.


Poster: kevin3442
Dated: Thursday June 17 2004 - 2:40:53 BST

ACIDSTEALTH wrote:
OK, so I fixed that error and another error came up.
Line 17
character 3922
error " '_si" undefined

Check the "Home" item in your Main Menu. What did you forget?

Cheers,

Kevin


Poster: Maz
Dated: Thursday June 17 2004 - 2:45:36 BST

subimage="";
subimagepadding="2";

Do you have a url for subimage? Or have you removed that line?

Doubt that's the error message but it might cause the menu to not show.

maz


Poster: ACIDSTEALTH
Dated: Thursday June 17 2004 - 4:23:26 BST

Doh, can't belive I missed that, lol.

But it works now. :D Thanks guys, I surly wouldn't of got it figured out without ya! :lol:


Poster: ACIDSTEALTH
Dated: Thursday June 17 2004 - 5:47:38 BST

Just a few more quick questions,

What is the code to prevent a line break. I need to make the menu a bit wider so line breaks don't occur.

Lastly, how do I center the menu. I already have the alignment set to center but it renders on the left?


Poster: Maz
Dated: Thursday June 17 2004 - 6:12:35 BST

Glad you got it :D

& n b s p ;
is a space to use between words, but take out the spaces or it would look like a space here too.

The style above the menu items try these:
menualign="center";
screenposition="center";

In global style to center text:
align="center";

Also check the style links below for more ways to change the styles.

maz


Poster: ACIDSTEALTH
Dated: Thursday June 17 2004 - 22:22:42 BST

OK, I got the spaces done and probably last two questions,

I still can't center iteven with the centering code and using html to center it is just as useless.

Also, if you add the milonic link in the menu, like if i added it under the links menu, shouldn't the one on the main menu dissapear because i already have another link on the menu for it?


Poster: Maz
Dated: Friday June 18 2004 - 0:40:07 BST

Looking at the link you gave above, I don't see anything to center.

style=menuStyle;
top=100;
left=10;
alwaysvisible=1;
orientation="horizontal";


you need to include:

screenposition="center";

You might also want:

menualign="center";


Then check styles you might want to use other things such as

menuwidth="100%";
itemwidth="100%";

The only problem I have is your colors on Safari its almost impossible to read because they are dark.

I couldn't see any milonic link although I can't read the menu.

maz


Poster: ACIDSTEALTH
Dated: Friday June 18 2004 - 5:42:30 BST

Opps, forgot to update the one online, but yes, I did have that stuff and it still renders on the left.

And the Milonic link is located under the Saudec (links) tab. I put the stuff in bold and changed the colors a bit, shuld be easyer to see now. :)