Error with converted menus

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
User avatar
simongdawson
Super Advanced
Super Advanced
Posts: 49
Joined: Sun Oct 12, 2003 6:56 am
Location: UK
Contact:

Error with converted menus

Post by simongdawson »

My converted menus (menu_data_1.js and menu_data_2.js) both give the
same error message:

Line: 12
Char: 6
Error: Syntax Error
Code: 0
URL: <http://www.the-limes.com/milonic5_test.html>

and neither of the menus display.

The menus worked perfectly in v3. I then used the menu converter on the Milonic site to convert them to v5 and added the relevant additional files to my website. All of the milonic menu files (both v3 and v5) are located on my website in the directory http://www.the-limes.com/java/

Can anyone tell me how to correct this, please?
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Check the style names, they should be different for each menu and submenu. Check your file paths.

I need sleep now.
maz
User avatar
bobwill
Mega Advanced
Mega Advanced
Posts: 229
Joined: Tue Oct 01, 2002 3:03 pm
Location: Kansas
Contact:

Post by bobwill »

One of the things that I spotted is the lack of a ";" at the end of each line.

You have:
aI("text=Simons Work;showmenu=WorkMenu;url=#;status=Mouse over to see menu for Simons work")

I beleive it should be:
aI("text=Simons Work;showmenu=WorkMenu;url=#;status=Mouse over to see menu for Simons work;");

A ";" is used to end each option and also the end of the line of code.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

I see at least 2 problems...

1. Your JS calls in the HTML are wrong. I don't remember exactly when the format changed, but you will need to read install.txt that is in the new download - it's there for a reason.

2. RC17 is the current release. You are running RC11. Upgrade.

Many of us are finding the calls work better as the first items after the <body> tag, although they should work in either place. This is not the cause of your error, however. I suspect you'll find that in #1.
John
User avatar
simongdawson
Super Advanced
Super Advanced
Posts: 49
Joined: Sun Oct 12, 2003 6:56 am
Location: UK
Contact:

Post by simongdawson »

I've done all the things above (latest RC17, added semicolons, new js calls in html) but still nothing. I don't know if it is relevant but the downloaded sample menu doesn't work either - see http://www.the-limes.com/milonic5_sample.html

Is it anything to do with my having the scripts in a separate directory?
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

simongdawson wrote:Is it anything to do with my having the scripts in a separate directory?
No, just so the calls to the JS are correct.

However, your milonic_src.js still shows as RC11, while the other 2 code files show RC17. They must all be the same version.
John
User avatar
simongdawson
Super Advanced
Super Advanced
Posts: 49
Joined: Sun Oct 12, 2003 6:56 am
Location: UK
Contact:

Post by simongdawson »

jgillett wrote:However, your milonic_src.js still shows as RC11, while the other 2 code files show RC17. They must all be the same version.
They were all (inc. milonic_src.js) updated at the same time to RC17. It must have been some sort of cached version you saw, or a temporary internet file.
User avatar
simongdawson
Super Advanced
Super Advanced
Posts: 49
Joined: Sun Oct 12, 2003 6:56 am
Location: UK
Contact:

Post by simongdawson »

I've been experimenting. I've just made a new directory at http://www.the-limes.com/milonic/ and then copied into it the v5 sample files and made a new html page in that diectory http://www.the-limes.com/milonic/sample.html onto which I pasted the js calls from readme.txt. The menu works perfectly. I then copied to http://www.the-limes.com/milonic/ my own two menu_data files and called them up from a new page within the directory http://www.the-limes.com/milonic/test.html. menu_data_1 works perfectly, menu_data_2 still has a problem, so I have temporarily put it between <!-- and --> . Please note that all of these .js files are just copies from the /Java/ directory on my website and not altered in any way.

There is definitely something wrong in the way that the menu script is handling the location of scripts when they are not in the same directory as the page calling for them.

RC8 had a line at the top of milonic_src.js reading //scriptpath=""; which could be altered e.g. scriptpath="/java/"; but this line does not exist in RC17 and when I added it, it made no difference.

Does this help you to help me, please?
User avatar
fredlongworthhighschool
Mega Advanced
Mega Advanced
Posts: 362
Joined: Fri Jun 27, 2003 11:34 am
Location: Manchester, England.
Contact:

Post by fredlongworthhighschool »

"Scriptpath" was removed last month. There is more about it here http://milonic.com/forum/viewtopic.php?t=2529
Andy Davis
Web Designer & Smartboard Manager

Fred Longworth High School, Manchester, England.
User avatar
bobwill
Mega Advanced
Mega Advanced
Posts: 229
Joined: Tue Oct 01, 2002 3:03 pm
Location: Kansas
Contact:

Post by bobwill »

In "menu data 2" you have the following code:

with(=new mm_style()){
offcolor="#228B22";
offbgcolor="#FFFFF0";
oncolor="#FF0000";
onbgcolor="#FFFFF0";
fontsize="14";
fontstyle="normal";
fontweight="bold";
fontfamily="Tahoma,Helvetica,Verdana";
padding=2;

You have a missing name on the the first line, plus I not sure that code is not suppose to be deleted since you follow it with the correct code in your file.

with(somename=new mm_style()){
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Nice catch, BW. I missed that one. Hopefully that's it.

Andy is correct on scriptpath. It's gone, so don't try to add it back in.
simongdawson wrote:There is definitely something wrong in the way that the menu script is handling the location of scripts when they are not in the same directory as the page calling for them.
Actually that function works just fine. The problem is elsewhere.
John
User avatar
simongdawson
Super Advanced
Super Advanced
Posts: 49
Joined: Sun Oct 12, 2003 6:56 am
Location: UK
Contact:

Post by simongdawson »

I cannot for the life of me explain this, but....

I got the sample and my two menu_data files working in the http://www.the-limes.com/milonic/ directory on the pages http://www.the-limes.com/milonic/sample.html and http://www.the-limes.com/milonic/test.html.

I then changed the links to on http://www.the-limes.com/milonic5_test.html to link to the /milonic/ files instead of the /java/ files and lo and behold the page and menu worked perfectly. So I copied the files again form /milonic/ to /java/ to make sure that they were the same. Changed the js calls on http://www.the-limes.com/milonic5_test.html back to the /java/ files and it was back to not working. They only seem to work in the other /milonic/ directory.........
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

You still need your /milonic/ paths:

<SCRIPT language=JavaScript src="/milonic/milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=/milonic/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=/milonic/mmenudom.js><\/scr"+"ipt>");
</script>
<SCRIPT language=JavaScript src="/milonic/menu_data.js" type=text/javascript></SCRIPT>

Regards
maz
User avatar
simongdawson
Super Advanced
Super Advanced
Posts: 49
Joined: Sun Oct 12, 2003 6:56 am
Location: UK
Contact:

Post by simongdawson »

maz wrote:You still need your /milonic/ paths:

<SCRIPT language=JavaScript src="/milonic/milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=/milonic/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=/milonic/mmenudom.js><\/scr"+"ipt>");
</script>
<SCRIPT language=JavaScript src="/milonic/menu_data.js" type=text/javascript></SCRIPT>

Regards
maz
Yes, they work like that. But why, when I have exactly the same files in the /java/ directory does it not work if I change the js calls to the /java/ directory?
User avatar
bobwill
Mega Advanced
Mega Advanced
Posts: 229
Joined: Tue Oct 01, 2002 3:03 pm
Location: Kansas
Contact:

Post by bobwill »

I just checked out the link http://www.the-limes.com/milonic5_test.html and this file still points to the "milonic" directory. Where is the test link that uses the "java" directory??
User avatar
simongdawson
Super Advanced
Super Advanced
Posts: 49
Joined: Sun Oct 12, 2003 6:56 am
Location: UK
Contact:

Post by simongdawson »

bobwill wrote:I just checked out the link http://www.the-limes.com/milonic5_test.html and this file still points to the "milonic" directory. Where is the test link that uses the "java" directory??
Sorry about that - I've been using the same test page and editing the js calls from one directory to another. Now I have set up two test pages, one for each directory. The /java/ test page is now at http://www.the-limes.com/milonic5_test2.html whereas the /milonic/ test page is at http://www.the-limes.com/milonic5_test.html
bzeitner
Super Advanced
Super Advanced
Posts: 32
Joined: Thu Oct 02, 2003 6:02 pm

Post by bzeitner »

The http://www.the-limes.com/milonic5_test2.html link had no issues using IE6. But I did notice a problem that you may want to clear up in menu_data_1.js and menu_data_2.js:

Code: Select all

with(milonic=new menuname("SubMenu")){
itemwidth=110;
style=menuStyle;
aI("text=Simons Work;showmenu=WorkMenu;url=#;status=Mouse over to see menu for Simons work");
aI("text=Genealogy;showmenu=GenealogyMenu;url=#;status=Mouse over for Genealogy menu");
aI("text=Contacts;showmenu=ContactMenu;url=#;status=Mouse over for Contacts menu");
aI("text=Links;showmenu=LinksMenu;url=#;status=Mouse over to see Links menu");
aI("text=Guest Book;url=http://www.the-limes.com/guestbook/index.php;;status=Click to go to our Guest Book");
aI("text=Search;url=http://www.the-limes.com/search/search.html;;status=Click to search within our web site");
}

with(milonic=new menuname("EmailMenu")){
itemwidth=60;
style=menuStyle;
aI("text=Thelma;url=mailto:tdawson@the-limes.com;;status=Click to email Thelma");
aI("text=Simon;url=mailto:simon@the-limes.com;;status=Click to email Simon");
}
Notice the double semicolon's before the status? and no semicolon before the end of the line's quotation mark? Good practice would be as follows:

Code: Select all

aI("text=Simons Work;showmenu=WorkMenu;url=#;status=Mouse over to see menu for Simons work;");
Also, the following code, at the top of each file, only needs to be declared once for each page. Keep it in the first menu you call. Otherwise, you're just wasting space.

Code: Select all

_menuCloseDelay=500;
_menuOpenDelay=150;
_scrollAmount=3;
_scrollDelay=20;
_followSpeed=5;
_followRate=40;
_subOffsetTop=4;
_subOffsetLeft=6;
Last edited by bzeitner on Tue Oct 14, 2003 7:44 pm, edited 1 time in total.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

bzeitner wrote:Notice the double semicolon's before the status? and no semicolon before the end of the line's quotation mark?
Technically they should be there, you are correct. However, I'm pretty sure Andy has allowed for those missing and for the doubles (put there by the converter).
John
bzeitner
Super Advanced
Super Advanced
Posts: 32
Joined: Thu Oct 02, 2003 6:02 pm

Post by bzeitner »

I think I found the source of your issue... in the /milonic/menu_data_2.js file, I found the following line:

Code: Select all

aI("text=<script language='JavaScript'>dT();</script>;url=#;align=right;;status=#;");
I really don't think the menu is set up to handle something like that. Or could I be wrong? Even if it does work, I don't see this function declared in any of the included source files.
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Yes you are allowed to incorporate SCRIPT includes into the text of a menu item. Whatever is inside those script tags is executed as if it was written out in the open in the page. You just have to nail the syntax and what your quotes and single quotes. ;)
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
Post Reply