Javascript included in a menu link.

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
jnewton
Advanced
Advanced
Posts: 15
Joined: Wed Feb 04, 2004 9:07 pm
Location: Norfolk, VA

Javascript included in a menu link.

Post by jnewton »

I need to have an alert() pop up and warm people when they are leaving the secure network and when they click "ok" it will continue with the transfer.

It is simple to do in html -

<A href="link" onClick=alert('warning')">Link description</a>

I've just not ben able to figure it out how to get this to work in the menu.

Thank,

John
USCG, MLCA
jnewton
Advanced
Advanced
Posts: 15
Joined: Wed Feb 04, 2004 9:07 pm
Location: Norfolk, VA

Post by jnewton »

Well, I got a little industries and developed a simple function that can be called to do what I want.

function notice(url)
{
alert('Links from this page to non-Coast Guard sites are provided as a customer service and do not represent any implicit or explicit endorsement by the United States Coast Guard of any commercial or private issues or products presented there.');
outsideWindow = window.open(url);
outsideWindow.focus();
}

Then in the menu I set url=javascript:notice('the link');

It displays the required disclamier and then opens the link in a new window.
User avatar
rudy
Mega User
Mega User
Posts: 161
Joined: Thu Jan 15, 2004 11:39 pm
Location: Scottsdale, Arizona
Contact:

Like to see it

Post by rudy »

Can you give your URL? Would like to see this in action. I could use something like that on my Web site. :D
Rudy
Post Reply