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:27

Re: Click event not firing


Poster: Ruth
Dated: Monday October 15 2007 - 15:50:16 BST

Hi,

I will post to Milonic about this. This is really beyond my knowledge, way beyond it. Maybe it's because the menu is a separate object? I wonder if you put the function you're using in the menu data file, also? since the message is the 'undefined' Then again, what do I know? As Schultz says "I know nothing" :lol: As you can see I'm just grabbing things and guessing. Though I'm posting to Milonic I think you will need to contact them. They are problably going to have to do some testing of the webtrends thing and the menu which we cannot do here on the forum.

Ruth

Click event not firing


Poster: jsmotherman
Dated: Friday October 12 2007 - 21:03:18 BST

I need to capture the window.event in javascript, but when I add "clickfunction=alert(window.event)" or "url=javascript:alert(window.event)" to a menu item I get "undefined" as the message. Does any window event fire when clicking the menu?

Re: Click event not firing


Poster: Ruth
Dated: Saturday October 13 2007 - 5:05:37 BST

Hi,

I think undefined is saying that the function is underfined. I'm not sure how you would capture a window event from the menu. If you clicked on the menu, it would be a click on the menu.

Put this at the top of your data file

Code:
function theFunction(theParameter)
{
  alert(theParameter);
}


Then the aI string could be any of the following
Uses url=javascript:

Code:
aI("text=This has a js function in the url;url=javascript:theFunction(1);");

uses clickfunction
Code:
aI("text=This has a js function when clicked;clickfunction=theFunction(2);");


uses type=html; and an image, you'll have to make your own image or no image and it will probably give you an x.
Code:
aI("text=<IMG SRC='3.gif' WIDTH='50' HEIGHT='15' BORDER='0' ALIGN='Top' onclick='theFunction(3)'>;type=html;");


There is a demo for a function to test if the main menu is drawn before any of your routines are run called Set Time Out here http://support.milonic.com/demos/

Hope this helps.

Ruth

Re: Click event not firing


Poster: jsmotherman
Dated: Monday October 15 2007 - 15:23:46 BST

Thanks. I am very familiar with the methods you posted. My problem is that I am using Webtrends for analytics on my site. Webtrends has provided me with code that listens for and captures all window events (i.e. click events) and logs them appropriately - I cannot alter their code. This works fine for everything on my site except for the Milonic menu. I'm just trying to figure out why clicking on the menu is not a click event.

Re: Click event not firing: Solution


Poster: jsmotherman
Dated: Monday October 15 2007 - 16:22:46 BST

Thanks, Ruth.

I just got it to work by using HTML as follows:
aI("text=<a href=http:www.indy.org>Indianapolis</a>;type=html;");

Notice there's no need for any functions. Keeping it simple solved the problem.

Thanks again for all of your help.

Re: Click event not firing


Poster: Ruth
Dated: Monday October 15 2007 - 16:41:29 BST

Hi,

That seems to imply that the Webtrends didn't read the url= as a hyperlink. Thanks for posting the solution in case anyone else needs it :)

Ruth

Re: Click event not firing


Poster: Andy
Dated: Monday October 15 2007 - 17:17:08 BST

Hi,

Which version of the menu are you using?

This used to be a problem with ealier versions until we added an actual link to the menu items.

I've just tried it with the latest version and Apache does add log records on our development server when a menu item is clicked on.

Cheers,
Andy

Re: Click event not firing


Poster: Andy
Dated: Monday October 15 2007 - 17:20:23 BST

After reading the first message again you mention clickfunction and url=javascript: - I'm not sure the browser will send anything to the server because using javascript to fire links is not makeing a new request to the web server because it's all happening on the client.

Real links should not be a problem, if they are, there must be something wrong.