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:17
Call a javascript file in a menu
Poster: leonard
Dated: Tuesday July 27 2004 - 10:53:35 BST
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
Leonard
Poster: Maz
Dated: Tuesday July 27 2004 - 15:09:02 BST
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
Poster: John
Dated: Tuesday July 27 2004 - 15:13:30 BST
onfunction= and offfunction= might help. See http://www.milonic.com/forum/viewtopic.php?t=2981 for some good (and necessary) reading.
Poster: leonard
Dated: Tuesday July 27 2004 - 22:04:24 BST
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 "" and this seams to work:
aI("text=Send Email;url=%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
Poster: fredlongworthhighschool
Dated: Wednesday July 28 2004 - 9:13:49 BST
I've used this in one of my menus which seems to work:
Code:
aI("text=Popup;url=javascript:alert(sometext);");
sometext="This is a popup Javascript box.";
sometext="This is a popup Javascript box.";
Perhaps this would give you a start?
Poster: leonard
Dated: Saturday July 31 2004 - 6:04:09 BST
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
Poster: leonard
Dated: Monday August 2 2004 - 20:18:13 BST
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
Poster: kevin3442
Dated: Sunday August 15 2004 - 10:24:00 BST
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