Call a javascript file in a menu

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
User avatar
leonard
Beginner
Beginner
Posts: 9
Joined: Tue Jul 27, 2004 10:24 am
Location: Flagstaff, Arizona
Contact:

Call a javascript file in a menu

Post by leonard »

Hello all,

How can I call and execute a javascript file in a menu
with url, clickfunction or etc?

Here is one of my bad attempts:
aI("text=Email Us;clickfunction=javascript:document.write(\"<script language='JavaScript' src='/bins/js-bin/email.js' type='text/javascript'></script>\")\;;status=Send Email to Meteor Crater;separatorsize=4");

http://meteorcrater.sciencedata.net/

Thanks :lol:

Leonard
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Hi Leonard,

I'll admit I'm totally novice on js. However, I think what you are looking for is
javascript= ;

another useful property is:
text= ;type=html;
that allows you to use html in the text field.

maz
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

onfunction= and offfunction= might help. See http://milonic.com/forum/viewtopic.php?t=2981 for some good (and necessary) reading.
John
User avatar
leonard
Beginner
Beginner
Posts: 9
Joined: Tue Jul 27, 2004 10:24 am
Location: Flagstaff, Arizona
Contact:

Post by leonard »

Thanks for the help, but I could not get a link to the "javascript=" to execute (probably don't know what I'm doing):
aI("text=Email Us;javascript=/bins/js-bin/email.js;status=Send Email");
The script would encrypt email address from spammers.

I just wanted a simple mangled "mailto:" and this seams to work: :roll:
aI("text=Send Email;url=mailto:%73%6F%6D%65%62%6F%64%79%40%73%6F%6D%65%70%6C%61%63%65%2E%63%6F%6D;status=Send Email");

Thanks
User avatar
fredlongworthhighschool
Mega Advanced
Mega Advanced
Posts: 362
Joined: Fri Jun 27, 2003 11:34 am
Location: Manchester, England.
Contact:

Post by fredlongworthhighschool »

I've used this in one of my menus which seems to work:

Code: Select all

aI("text=Popup;url=javascript:alert(sometext);");
sometext="This is a popup Javascript box.";
Perhaps this would give you a start?
Andy Davis
Web Designer & Smartboard Manager

Fred Longworth High School, Manchester, England.
User avatar
leonard
Beginner
Beginner
Posts: 9
Joined: Tue Jul 27, 2004 10:24 am
Location: Flagstaff, Arizona
Contact:

Post by leonard »

I think you are calling an inline javascript command. I am trying to call a javascript file like:

/bins/js-bin/email.js

aI("text=Email Us;javascript=/bins/js-bin/email.js;status=Send Email;"); ???

Can anyone give an example of calling a javascript file {filename.js} as a menu item?

Thanks,

Leonard
User avatar
leonard
Beginner
Beginner
Posts: 9
Joined: Tue Jul 27, 2004 10:24 am
Location: Flagstaff, Arizona
Contact:

Post by leonard »

aI("text=Email Us;javascript=/bins/js-bin/email.js;status=Send Email;");
The above does not work?

Can anyone give an example of calling a javascript file {filename.js} as a menu item?

Thanks, :?

Leonard
User avatar
leonard
Beginner
Beginner
Posts: 9
Joined: Tue Jul 27, 2004 10:24 am
Location: Flagstaff, Arizona
Contact:

Post by leonard »

Can anyone give an example? :)
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Leonard,

I'm not sure what you mean by "call a javascript file." There really isn't any way to do that, menu or otherwise. Typically, you load a .js file into the page, then call its various functions from different links in the page or from various events in the browser.

Maybe if you describe the kind of functionality you're going for, we can take it from there...

Cheers,

Kevin
Post Reply