Problem using javascript:myfunction() syntax in primary URL

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
speedphreak
Beginner
Beginner
Posts: 1
Joined: Tue Jul 15, 2003 3:13 pm

Problem using javascript:myfunction() syntax in primary URL

Post by speedphreak »

I used the syntax "javascript:myfunction()" as the URL to get javascript to run from the menu which works fine.... IF it's the secondary URL. Used as a primary URL, the menu doesn't see the MouseOver & change color, and disappears. If you click on the item quickly enough it will run the javascript, but the menu behaves as if there is no link there to click. Is there anyway to fix this... I've been experimenting with using "#" or "" as the primary URL, along with a few other things... please let me know if you have any ideas. If you'd like to take a look at the behaviour let me know, and I'll post a link. THanks for the help!
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Lemme guess... you're passing literal strings to your function???

I have seen exactly the same behavior you describe... occurring only in top level menus (or perhaps in any Always Visible menu... never tested that theory though). I found that I only saw that behavior if I passed one or more literal strings as parameters. Numeric parameters do not cause the effect. I have a habit of using single quotes around literal strings if they are already inside of double quotes, as is the case with a menu item definition. That won't work in a menu item at the top level, not even if you escape the single quote. What I found will work is using escaped double quotes around literal string parameters.

Hope that helps,

Kevin
Post Reply