Recently I came to the conclusion that I should write about JavaScript menus. Why? Well, the other day I was searching for my name in Google and noticed that the top hits, and most of the hits, were related to mm_menu.js and fw_menu.js. Now I know its bad form to Google for your own name, but trust me, I was provoked. I noticed in my local blog searches people were searching for menu and mm_menu, despite the fact that I have never written about them on this blog. So why were people looking for them here? It turns out the very top of the mm_menu.js file has this:

* mm_menu 20MAR2002 Version 6.0
* Andy Finnell, March 2002
* Copyright © 2000-2002 Macromedia, Inc.

Ah, in those days I was young and foolish. Foolish enough to leave an electronic paper trail back to me. You don’t see me making that mistake again.

I ended up looking at a lot of the sites that referenced mm_menu or fw_menu. They are typically web developer forums. Most the conversations on said forums go like this:

Newbie: I’ve got these mm_menu.js menus, and I want to them to scroll/delay showing/be horizontal/play the harmonica.

Expert (usually Murray): Those menus suck, don’t use them.

Newbie: But I have most of it working already. I don’t want to start over again.

Expert/Murray: Curse you Marcodobia!

The conversation usually goes downhill from there. There’s also the misunderstanding that I own those menus or even created them. One poster suggested that they take up a collection and pay me to add more features. Ha ha! Dude, I like the idea of you giving me money, but not the idea of me coming within ten miles of the menu code.

How did I get involved with this if I’m not the creator of this mess, you ask? *sigh* Well, if you insist on asking me that question, I guess I have answer it.

I was tricked into it, like most things. I had just started on the Fireworks team at Macromedia when they were trying to push out Fireworks 4.0.2, a bugfix release. The JavaScript menu feature had been released in the 4.0 release, and they had a serious bug already. This would have been a warning sign to anyone with experience, but not me. My boss innocently said, “Say Andy, we’ve got this one simple bug in the menus code. Could you take a look at it?” Not realizing that was manager code for “Run! Run like the wind!” I said “Sure” and went to work. It was a bug in Internet Explorer. A bug that started my hate-affair with IE. I managed to get a work around in that didn’t bloat the code too much more than the already 20k it was at. I thought that was the last I’d have to deal with that code. But no. Through the scientific process of “you touched it last, you own it” I now had to maintain it for the rest of my career at Macromedia.

You see, I didn’t even create this mess. It all started with some dude over at Netscape named “Gary.” (Most likely a pseudonym. He probably had enough sense not to leave his real name on anything.) He wrote this JavaScript library that allowed menus to be created on the fly in Netscape 4. Yep. Netscape 4. As the legend goes, towards the end of the Fireworks 4 development cycle, someone decided JavaScript menus would be a great feature for Fireworks, a graphics program, to have. The engineer tasked with this feature didn’t have time to write such a thing himself, so he searched for something to start from. As fate would have it, he found “Gary”‘s JavaScript menus. Noticing that the JavaScript file wasn’t near bloated enough, the engineer added support for Internet Explorer and the then alleged Netscape 6. He managed to get it up to 25 kilobytes. Take that you 14.4kbps modem users.

For reasons now obvious, that engineer quickly fled the company and the state soon after the Fireworks 4 release.

Which left naive little me to deal with them. The next version of Fireworks, MX (Yeah, I know that’s not a version number, but tell it to the marketing guys. They have trouble with numbers vs letters.), was supposed to have many improvements to our hit feature, the JavaScript menus. By “hit feature”, I mean everyone loved them until they figured out how badly they sucked. Fortunately for us, you can’t try out a feature when the CD is still in the box.

Learning how the menus even worked was a huge pain the backside. It was a lot of non-obvious, uncommented code. But I figured it out and added all the features management claimed we needed, and managed to bloat the code by 5k. It was also during this time I realized what a mess it was, and how badly we needed to scrap it and start all over again. I also helped tech support and customers out by telling them how to hack the code to add features we weren’t going to add directly. This was a mistake because, once again, I used my real name.

When we released MX, the customers marveled at how much code I managed to add without really improving anything. The experts complained because the menus were still huge, slow, inaccessible, un-crawlable, and didn’t work if the user had JavaScript turned off. The newbies complained because although all the new features were nice, they just needed one more feature before they were happy.

Al Sparber just laughed his way to the bank. (He sells competing HTML menus.)

For the next release there were murmuring of adding even more features. That’s when I pulled the engineer trump card and told them that new features couldn’t be implemented unless the menus were rewritten. That thoroughly killed menu work for the MX 2004 release. I began internally campaigning to have a new set of HTML/CSS menus created (there were lots of examples of these popping up externally).

There was a lot of internal movement between the MX 2004 and 8 release of Fireworks. I used that time to write a new version of the menus using HTML and CSS with a little bit of JavaScript. I cleverly substituted bloated JavaScript for bloated CSS. heh heh. That’ll show those experts. This was about the time I got moved off to Dreamweaver, and my good friend Mike ended up finishing up the feature (after it was killed, then brought back, then killed again, went on tour with the Stones, then finally revived.).

On the Dreamweaver side, we astutely decided not to support these new fangled menus, but still allowed the old kind to be created. This, of course, was heralded as a “Great Idea” by our advisors. No, just kidding, they hated it and called us names. Being the agile company that we were, we quickly had lots of emergency meetings and promptly decided not to do anything. That’s how Dreamweaver 8 shipped.

After Dreamweaver 8 shipped I left the company, and my involvement with those accursed menus ended.

Of course, none of this helps those of you suckered into using these menus. So for your benefit, I’ll now tell you how to fix the mm_menu.js. Follow these simple instructions:

  1. Acquire one (1) shotgun. Loaded, preferably.
  2. Acquire one (1) shovel.
  3. Pump mm_menu.js full of buckshot until you feel better.
  4. Repeat Step 3 as necessary or desired.
  5. With the shovel, dig a hole.
  6. Dump the remains of mm_menu.js into the hole.

If you’re confused on how to shoot an electronic file, I would suggest printing it out and shooting the printout. Sure, you could shoot the real thing off the hard drive, but you might have trouble determining if you hit the actual sectors the file resides on. Also, there might be economic and/or legal repercussions if you shot the hard drive.

So don’t use mm_menu or fw_menu. Go find one of the many HTML/CSS menus that are out there. Some are even free. You could even go buy one off Al Sparber. Tell him I sent you. For the number of people I’ve driven to his door by agreeing to maintain the JavaScript menus, he ought to give you some sort of discount.

Or perhaps he would just laugh maniacally at you and double the price.