2 menus on one page

Please note that official support for this menu version has now ceased. There are still plenty of users, though, and the forum is still running. Some of our long-time users may be able to help you out.
Post Reply
webmonkey8
Advanced
Advanced
Posts: 11
Joined: Fri Oct 03, 2003 10:30 pm

2 menus on one page

Post by webmonkey8 »

Is there a way you can have 2 master menus running on one page at a time? I'm using Menu version 3.3.19. Everytime I try to implement 2 or more on a page, I get this javascript error "stack overflow". I even renamed the js. files and have the second menu pointing to a different location. Can you help?
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

The very first thing you need to do is upgrade to 3.5.15. This is the last release in the v3 series, which is no longer supported. Note that at your current version you are more than 20 releases down!

If that doesn't work, come on back and post a URL for us.
John
webmonkey8
Advanced
Advanced
Posts: 11
Joined: Fri Oct 03, 2003 10:30 pm

not working

Post by webmonkey8 »

Ok, I have downloaded the version 3.5.15 menu and I still get that Javascript error message when I call 2 menus on the same page.
Eg,. Once menu is in a folder called 001 and the other is in a folder called 002. So essentially, I'm calling th same file "menu_array.js" from different folders. I call these file using an include statement. Call one of them works, but when calling 2 on the same page, it doesn't. Can you anyone help? Sorry I cannot post a URL since I'm working on an intranet.
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

at the top of the menu_array files there is a nice long line of code that looks pretty cryptic. This line can only appear once per page. So leave it in your first menu file, and comment it out in the second file. See if that fixes the problem.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
webmonkey8
Advanced
Advanced
Posts: 11
Joined: Fri Oct 03, 2003 10:30 pm

trouble

Post by webmonkey8 »

Ok, so I've setup an internet URL so you can take a look at my problem:
http://www.acsc.gov.ab.ca/menu/side_menu.htm

As you can see if you go to that page, you get a "Stack overflow error: Line 508".

I'm trying to implement 2 separate menus here. One (the top menu) is calling menu_array.js and mmenu.js and the secong menu (bottom) is calling menu_array02.js and mmenu02.js and I still get that error.

Please help! :cry:
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Good, you commented out that line in the second menu_data file, ok. You need only ONE reference to mmenu in each page. So include your menu_data1 file (with the critical line in use), include your menu_data2 file (with the critical line commented out), and then include one mmenu file after all that.

Second, you still are using 3.3.15, go to the versions page on the milonic.com page and download 3.5 if you absolutely MUST stick with version 3. Otherwise I would recommend going to v5.

This should take care of things for you. Enjoy your Milonic Menu!
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Please keep in mind, the v3 series is no longer supported. v5 is really the way to go.

Take a look at http://tiggrsuccess.com/ for an example of 2 on the same page - one horizontal and one vertical.
John
webmonkey8
Advanced
Advanced
Posts: 11
Joined: Fri Oct 03, 2003 10:30 pm

Post by webmonkey8 »

It's still not working even when I have both menus point to ONE mmenu.js.
Take a look at my code, maybe I'm missing something, but I get the same error message. The first top menu is showing, but the exact same copy of it, below it, is blank:


<table width="161" border="0" cellspacing="0" cellpadding="0" bgcolor="B6C5C7">
<tr>
<td><img src="http://acscinfolinktest.gov.ab.ca/image ... es_sub.gif" width="161" height="18"></td>
</tr>
<tr>
<td height="10"><img src="images/spacer.gif" width="40" height="1"> <img src="images/spacer.gif" width="1" height="1">
</td>
</tr>
<tr>
<td> <p>
<script language=JavaScript src="menu_array.js" type=text/javascript></script>
<script language=JavaScript src="mmenu.js" type=text/javascript></script>
<br>
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><br>
<br>
</p></td>
</tr>
</table>
<p>&nbsp;</p>
<table width="161" border="0" cellspacing="0" cellpadding="0" bgcolor="B6C5C7">
<tr>
<td><img src="http://acscinfolinktest.gov.ab.ca/image ... es_sub.gif" width="161" height="18"></td>
</tr>
<tr>
<td height="10"><img src="images/spacer.gif" width="40" height="1"> <img src="images/spacer.gif" width="1" height="1">
</td>
</tr>
<tr>
<td> <p>
<script language=JavaScript src="menu_array02.js" type=text/javascript></script>
<script language=JavaScript src="mmenu.js" type=text/javascript></script>
<br>
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><br>
<br>
</p></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
<p>&nbsp;</p>
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

No no no, you only include mmenu one time. This is exactly as you should do it.

Code: Select all

<script language=JavaScript src="menu_array.js" type=text/javascript></script>
<script language=JavaScript src="menu_array02.js" type=text/javascript></script>
<script language=JavaScript src="mmenu.js" type=text/javascript></script>
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
webmonkey8
Advanced
Advanced
Posts: 11
Joined: Fri Oct 03, 2003 10:30 pm

Post by webmonkey8 »

Well, it seems to work now! :) Thanks a lot!! Now I gotta customize. I found that having only one mmenu.js on my page would get rid of that "stack overload" error, which is what you said. Anyways, thanks for the help.
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Definetly no problem. That mmenu file initializes alot of things and have multiple copies of everything can definetly overwhelm the browser's memory. I can't stress enough though that you would benefit greatly by moving to version 5. Just a thought... ;) .
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
Post Reply