Javascript Function not displaying correctly in menu item
Javascript Function not displaying correctly in menu item
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?
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?
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:
Cheers
Andy
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: Select all
aI("text=Chat Room;url=JavaScript:openWindow6('chat/chatroom.asp');image=http://www.kcrpca.org/images/chatrm5.gif;status=;");
Andy
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?
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?
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!
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!
Hi,
Try using escaped double-quotes instead of single quotes around literal string parameters in the funciton call. I.e., use
instead of
Kevin
Try using escaped double-quotes instead of single quotes around literal string parameters in the funciton call. I.e., use
Code: Select all
...url=javascript:functionName(\"param1\",\"param2\")...
Code: Select all
...url=javascript:functionName('param1','param2')...
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!
Thanks a bunch!
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
Ruth
Last edited by Ruth on Fri Jul 02, 2004 9:14 pm, edited 2 times in total.
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.
I'm not sure I could fix either, but it would be interesting to know.