I am working on some site changes for a friend (he works at a legal firm) who has a navigation bar on the left side of his website. On hover, these show a submenu. Unfortunately, he tried to take out one of the submenu items and lost all of the functionality of the submenu navigation. Now, instead of showing submenus, it shows nothing but an error.
Here's the code before (where its working):
<script language="JavaScript">
<!--
function mmLoadMenus() {
if (window.mm_menu_0327091831_0) return;
window.mm_menu_0327091831_0 = new Menu("root",225,30,"Optima, Verdana, Helvetica Neue, sans-serif",14,"#FFFFFF","#FFFFFF","#7E7D7D","#B3B3B3","left","middle",8,0,250,-5,7,true,false,true,0,true,true);
mm_menu_0327091831_0.addMenuItem("HARRY GRIFF, P.C.","location='harry-griff.html'");
mm_menu_0327091831_0.addMenuItem("DOUGLAS E. LARSON, P.C.","location='doug-larson.html'");
mm_menu_0327091831_0.addMenuItem("STEPHEN L. LAICHE, P.C.","location='stephen-laiche.html'");
mm_menu_0327091831_0.addMenuItem("BRAD R. WRIGHT, P.L.L.C.","location='brad-wright.html'");
mm_menu_0327091831_0.hideOnMouseOut=true;
mm_menu_0327091831_0.bgColor='#555555';
mm_menu_0327091831_0.menuBorder=1;
mm_menu_0327091831_0.menuLiteBgColor='#FFFFFF';
mm_menu_0327091831_0.menuBorderBgColor='#777777';
mm_menu_0327091831_0.writeMenus();
} // mmLoadMenus()
//-->
</script>
Here's the code after:
<script language="JavaScript">
<!--
function mmLoadMenus() {
if (window.mm_menu_0327091831_0) return;
window.mm_menu_0327091831_0 = new Menu("root",225,30,"Optima, Verdana, Helvetica Neue, sans-serif",14,"#FFFFFF","#FFFFFF","#7E7D7D","#B3B3B3","left","middle",8,0,250,-5,7,true,false,true,0,true,true);
mm_menu_0327091831_0.addMenuItem("HARRY GRIFF, P.C.","location='harry-griff.html'");
mm_menu_0327091831_0.addMenuItem("DOUGLAS E. LARSON, P.C.","location='doug-larson.html'");
mm_menu_0327091831_0.addMenuItem("STEPHEN L. LAICHE, P.C.","location='stephen-laiche.html'");
mm_menu_0327091831_0.addMenuItem("BRAD R. WRIGHT, P.L.L.C.","location='brad-wright.html'");
mm_menu_0327091831_0.addMenuItem("BRAD R. WRIGHT, P.L.L.C.","location='rob-zentner.html'");
mm_menu_0327091831_0.hideOnMouseOut=true;
mm_menu_0327091831_0.bgColor='#555555';
mm_menu_0327091831_0.menuBorder=1;
mm_menu_0327091831_0.menuLiteBgColor='#FFFFFF';
mm_menu_0327091831_0.menuBorderBgColor='#777777';
mm_menu_0327091831_0.writeMenus();
} // mmLoadMenus()
//-->
</script>
Heres the site that is working:
first site (this is working, but is the page that needed a few updates
Heres the site that is not working:
second site (this is not working, hover over the attorney profiles button)
I just pasted the javascript that was changed, because that's where I think the problem is, but I can post more if needed.
Thanks for all help!
I am working on some site changes for a friend (he works at a legal firm) who has a navigation bar on the left side of his website. On hover, these show a submenu. Unfortunately, he tried to take out one of the submenu items and lost all of the functionality of the submenu navigation. Now, instead of showing submenus, it shows nothing but an error.
Here's the code before (where its working):
<script language="JavaScript">
<!--
function mmLoadMenus() {
if (window.mm_menu_0327091831_0) return;
window.mm_menu_0327091831_0 = new Menu("root",225,30,"Optima, Verdana, Helvetica Neue, sans-serif",14,"#FFFFFF","#FFFFFF","#7E7D7D","#B3B3B3","left","middle",8,0,250,-5,7,true,false,true,0,true,true);
mm_menu_0327091831_0.addMenuItem("HARRY GRIFF, P.C.","location='harry-griff.html'");
mm_menu_0327091831_0.addMenuItem("DOUGLAS E. LARSON, P.C.","location='doug-larson.html'");
mm_menu_0327091831_0.addMenuItem("STEPHEN L. LAICHE, P.C.","location='stephen-laiche.html'");
mm_menu_0327091831_0.addMenuItem("BRAD R. WRIGHT, P.L.L.C.","location='brad-wright.html'");
mm_menu_0327091831_0.hideOnMouseOut=true;
mm_menu_0327091831_0.bgColor='#555555';
mm_menu_0327091831_0.menuBorder=1;
mm_menu_0327091831_0.menuLiteBgColor='#FFFFFF';
mm_menu_0327091831_0.menuBorderBgColor='#777777';
mm_menu_0327091831_0.writeMenus();
} // mmLoadMenus()
//-->
</script>
Here's the code after:
<script language="JavaScript">
<!--
function mmLoadMenus() {
if (window.mm_menu_0327091831_0) return;
window.mm_menu_0327091831_0 = new Menu("root",225,30,"Optima, Verdana, Helvetica Neue, sans-serif",14,"#FFFFFF","#FFFFFF","#7E7D7D","#B3B3B3","left","middle",8,0,250,-5,7,true,false,true,0,true,true);
mm_menu_0327091831_0.addMenuItem("HARRY GRIFF, P.C.","location='harry-griff.html'");
mm_menu_0327091831_0.addMenuItem("DOUGLAS E. LARSON, P.C.","location='doug-larson.html'");
mm_menu_0327091831_0.addMenuItem("STEPHEN L. LAICHE, P.C.","location='stephen-laiche.html'");
mm_menu_0327091831_0.addMenuItem("BRAD R. WRIGHT, P.L.L.C.","location='brad-wright.html'");
mm_menu_0327091831_0.addMenuItem("BRAD R. WRIGHT, P.L.L.C.","location='rob-zentner.html'");
mm_menu_0327091831_0.hideOnMouseOut=true;
mm_menu_0327091831_0.bgColor='#555555';
mm_menu_0327091831_0.menuBorder=1;
mm_menu_0327091831_0.menuLiteBgColor='#FFFFFF';
mm_menu_0327091831_0.menuBorderBgColor='#777777';
mm_menu_0327091831_0.writeMenus();
} // mmLoadMenus()
//-->
</script>
Heres the site that is working:
first site (this is working, but is the page that needed a few updates
Heres the site that is not working:
second site (this is not working, hover over the attorney profiles button)
I just pasted the javascript that was changed, because that's where I think the problem is, but I can post more if needed.
Thanks for all help!
Share Improve this question edited Oct 1, 2012 at 22:24 Muhambi asked Sep 29, 2012 at 0:15 MuhambiMuhambi 3,5226 gold badges33 silver badges57 bronze badges 3-
Just a guess after spending a few minutes on google, so YMMV: the
mmLoadMenus
function and its code is auto generated by Dreamweaver. My hunch is your friend hand edited the posted script. There is probably some other auto generated code somewhere else in the file that is still expecting the original number of menu items. If this is the case (again, guessing here), probably the best way to fix it is to go back into Dreamweaver and edit the menu items from the drap/drop gui interface and let it re-generate the script. – Bryan Commented Sep 29, 2012 at 2:39 - It would probably also be useful for you to post the error message you get and also a link to the site if it's publicly viewable. – Bryan Commented Sep 29, 2012 at 2:42
-
I don't see that one was taken out, I see that one was added by copy (the second
Brad
). Personally, I'd just get a new menu approach. – Jared Farrish Commented Sep 29, 2012 at 2:54
1 Answer
Reset to default 12 +100You have 2 different version of mm_menu.js
. And one of them has a syntax error. Note StackOverflow's syntax highlighting on the 2 snippets below.
http://www.gllblaw./mm_menu.js (the good version)
/**
* mm_menu 20MAR2002 Version 6.0
* Andy Finnell, March 2002
* Copyright (c) 2000-2002 Macromedia, Inc.
*
* based on menu.js
* by gary smith, July 1997
* Copyright (c) 1997-1999 Netscape Communications Corp.
*
* Netscape grants you a royalty free license to use or modify this
* software provided that this copyright notice appears on all copies.
* This software is provided "AS IS," without a warranty of any kind.
*/
function Menu(label, mw, mh, fnt, fs, fclr, fhclr, bg, bgh, halgn, valgn, pad, space, to, sx, sy, srel, opq, vert, idt, aw, ah)
{
// code here...
http://users.acsol/~jhart/mm_menu.js (The bad version)
/**
* mm_menu 20MAR2002 Version 6.0
* Andy Finnell, March 2002
* Copyright (c) 2000-2002 Macromedia, Inc.
*
/
function Menu(label, mw, mh, fnt, fs, fclr, fhclr, bg, bgh, halgn, valgn, pad, space, to, sx, sy, srel, opq, vert, idt, aw, ah)
{
// code here...
See the problem yet? In the header at the top of the bad version, the ment doesn't properly close. A multiline Javascript ment starts with /*
and ends with */
. However, this header ment is busted, it has no end-ment token. So the entire file is mented out and Menu
doesn't exist.
Close that ment properly and I bet things will work alright.
And so you know how to be a better developer yourself, here's how I figured this out.
I simply opened the developer tools in Chrome, and look at the JS console. Where, in bright red, I see this:
Which immediately told me of the syntax error, and what file and approximate line the error was on. Looking at the file and then seeing Chromes syntaxing highlighting styling the ENTIRE file like a ment (green), made it pretty obvious what was up.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745460486a4628687.html
评论列表(0条)