OnClick Function Duplication

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
User avatar
bobwill
Mega Advanced
Mega Advanced
Posts: 229
Joined: Tue Oct 01, 2002 3:03 pm
Location: Kansas
Contact:

OnClick Function Duplication

Post by bobwill »

I am trying to duplicate the "onclick" function in the Milonic Menu
The following line of code is an example of the html code that I am trying to duplicate. Not the file or URL as shown in the example, but the process as shown.

<a href="http://www.example.com" onClick="javascript: pageTracker._trackPageview('/outgoing/example.com');">

Here is my Milonic menu code.


aI("text=New Helmet Rule;url=/forms/helmet_rule.doc;status=New Helmet Rule;separatorsize=1;");


Is the following line the correct Milonic replacement code?

aI("text=New Helmet Rule;url=/forms/helmet_rule.doc;clickfunction=javascript: pageTracker._trackPageview('/forms/helmet_rule.doc') status=New Helmet Rule;separatorsize=1;");
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: OnClick Function Duplication

Post by Ruth »

Hiya Bob,

Well, since I don't do much js, and since I'd need some kind of 'function' to test I can only say that to me it looks as if that should work. That is how you set up a click function, so if the function is available to be triggered by the click, then I would think that the url part of the aI would open the doc, and the click function part would trigger the function when you clicked to open the doc. If you can't get it to work and you don't get a more definitive response here in a bit, I can only suggest that you contact Milonic directly. I will try to find some function out on the web to use and set up a click function plus say a pdf file to open and see what happens.

Ruth
User avatar
bobwill
Mega Advanced
Mega Advanced
Posts: 229
Joined: Tue Oct 01, 2002 3:03 pm
Location: Kansas
Contact:

Re: OnClick Function Duplication

Post by bobwill »

OK, thanks Ruth

This has to do with Google Analytics for me to track files that are being downloaded.
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Re: OnClick Function Duplication

Post by Andy »

Hi,

You don't need the javascript: setting for clickfunction, you've also got a space in there, try this instead:

Code: Select all

aI("text=New Helmet Rule;url=/forms/helmet_rule.doc;clickfunction=pageTracker._trackPageview('/forms/helmet_rule.doc');separatorsize=1;");
HTH,
Andy
User avatar
bobwill
Mega Advanced
Mega Advanced
Posts: 229
Joined: Tue Oct 01, 2002 3:03 pm
Location: Kansas
Contact:

Re: OnClick Function Duplication

Post by bobwill »

Thanks Andy. I will give it a try. I had already caught the blank space and replaced it with a semi-colon. I will remove the "javascript" statement and see how things go.
Shannon
Beginner
Beginner
Posts: 5
Joined: Wed Nov 19, 2008 8:14 pm

Re: OnClick Function Duplication

Post by Shannon »

Did anyone every get this to work?

I am also trying to use Google analytics to track outbound traffic.

This non-Milonic link works fine:

Code: Select all

<a target="_blank" href="http://websites.milonic.com/tennis-warehouse.com/" onClick="javascript: pageTracker._trackPageview('/outgoing/advertisers/TennisWarehouse/mainmenu');">Tennis Warehouse</a>
This Milonic menu item does go the right page, but Google analytics does not pick up the link like in the example above.

Code: Select all

aI("text=Tennis Warehouse;target=_blank;url=http://www.tennis-warehouse.com/;clickfunction=pageTracker._trackPageview('/outgoing/advertisers/TennisWarehouse/submenu');");
I clicked on each link 5 times. In Google analytics I see 5 visits to "'/outgoing/advertisers/TennisWarehouse/mainmenu" but none to "'/outgoing/advertisers/TennisWarehouse/submenu".

Thanks for the help.

Shannon
Post Reply