Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:21

Javascript Function not displaying correctly in menu item


Poster: PCAKen
Dated: Wednesday June 30 2004 - 17:05:57 BST

I have the most recent version of Milonic DHTML Menu (downloaded yesterday) and I am trying to create a menu item for a link to a pop-up chat room.

Here is the line from my file:

aI("text=Chat Room;url=JavaScript:openWindow6('chat/chatroom.asp');image=http://www.kcrpca.org/images/chatrm5.gif;");


This does create a menu item, you can browse to http://www.kcrpca.org and see this for yourself.

However, where the text is that says "Chat Room" the link if you over over it is actually Javascript:openWindow6(

If you move your cursor to the right of the words Chat Room, then the link becomes what it should be: Javascript:openWindow6('chat/chatroom.asp') and the function works correctly and the Chat Room is opened.

Is there a fix for this behavior so that hovering over the words Chat Room in the menu item displays the link correctly?


Poster: Andy
Dated: Wednesday June 30 2004 - 17:09:16 BST

Hi,

You'll need to decalre a status for the links that are pointing to javaScript functions.

You can declare an empty status if you need to clear the status bar completely:

Here's how:

Code:
aI("text=Chat Room;url=JavaScript:openWindow6('chat/chatroom.asp');image=http://www.kcrpca.org/images/chatrm5.gif;status=;");


Cheers
Andy


Poster: PCAKen
Dated: Wednesday June 30 2004 - 17:26:19 BST

Yep that worked, thanks for the fast reply.

One other quick question, how do you incorporate a horizontal divider line in a vertical menu to group some items together visually?


Poster: PCAKen
Dated: Wednesday June 30 2004 - 17:44:55 BST

Hmm I spoke to soon, on another menu item for pending tasks that also uses a Javascript function I am getting the same sort of results, even if I add a null status value. The only difference in the 2 menu items is that on the second one I am running some ASP code inline to count the number of tasks and display it in the menu line.

Here's the line I am using:

aI("text=Pending Tasks (<% =totalrcount %>);url=JavaScript:MM_showHideLayers('pending','','show');image=http://www.kcrpca.org/images/tasks2.jpg;status=;");


Thoughts?


Poster: PCAKen
Dated: Thursday July 1 2004 - 19:51:16 BST

Andy,

This still isn't working, and after adding some spacers the blank status on that one line quit working. Please check my site http://www.kcrpca.org and you'll see what I mean.

Thanks in advance!


Poster: kevin3442
Dated: Thursday July 1 2004 - 23:45:04 BST

Hi,

Try using escaped double-quotes instead of single quotes around literal string parameters in the funciton call. I.e., use
Code:
...url=javascript:functionName(\"param1\",\"param2\")...

instead of
Code:
...url=javascript:functionName('param1','param2')...


Kevin


Poster: PCAKen
Dated: Friday July 2 2004 - 2:39:44 BST

I found another error where I had missed something, but it was unrelated to the formatting of this. I tried your suggestion above and so far it seems to be working, at least in IE, I need to test it with some other browsers too. (Although IE was the only one where it was truncating before)

Thanks a bunch!


Poster: Ruth
Dated: Friday July 2 2004 - 4:35:40 BST

The chat link gives a window with a clock, which becomes a form box with pick nickname or something like that in Netscape 4.79, 6.1, 7, Opera 6.05, Firebird [fox] .07, IE 5.5. It doesn't work in Opera 7.11. You get the hand but nothing happens when you click the chat room link. Win98se.

Ruth


Poster: PCAKen
Dated: Friday July 2 2004 - 13:37:55 BST

Thanks for letting me know, but I was under the impression that the chat room was entirely a Flash application, and therefore, was browser neutral. Does Opera 7.11 do something different with Flash?


Poster: Ruth
Dated: Friday July 2 2004 - 14:01:54 BST

I meant that in Opera 7.11 when you mouseover the 'chat room' link in the menu the pointer changes to the hand but nothing happens when you click it. It's as if it's not a link, no window opens.

Ruth


Poster: PCAKen
Dated: Friday July 2 2004 - 14:46:41 BST

Any idea why that doesnt work in Opera? Is it the link itself or is it the Javascript that should pop the window? I think we can find out if you look around that website there are other javascript window-popping links, for example the details of a calendar event I believe are popped via javascript in the same way. If those links don't work for you (simple HTML links) then the problem is that Opera doesn't support whatever that javascript is doing. If those links work for you then the problem is that Opera doesn't interpret the menu item the same way as other browsers.

I'm not sure I could fix either, but it would be interesting to know.


Poster: Ruth
Dated: Friday July 2 2004 - 21:04:43 BST

They don't work either, so it's an opera problem with that.

Ruth