December 17th, 2012AWM: Can I run JavaScript code when clicking on a menu button?
Knowledge Base support case for AllWebMenus, abstracted and stripped of all user’s private info.
Initial Email From: User
Initial Email Subject: JavaScript code execution
Support Case Month: September 2012
The home page of this web site contains four buttons in the upper right hand corner of the page. The top two buttons execute some external JavaScript code that I have pasted in below. The other two buttons are just links. Is there something I can do in AllWebMenus, which I already have, to replace these buttons? Or do I need to get your Button Maker software?
The code is below
var user = "{INFO REMOVED}"; //for example - "{INFO REMOVED}"
var domain = "{INFO REMOVED}"; //for example - "{INFO REMOVED}"
var subject = "Info from Fanick's Garden Center "; //for example = "website feedback"
var bodytext = "Enter your message here"; //for example - "dear Joe, here are my comments"
document.write('<a href="mailto:' + user + '@' + domain + '?subject=' + subject + '&body=' + bodytext + '">');
document.write('<img id="imgemail" src="images/emailFlat.jpg" alt="Email Fanicks Garden Center for info" ></a>');if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
var url_EX=location.href;
var title_EX=document.title;
document.write('<A HREF="javascript:window.ext');
document.write('ernal.AddFavorite(url_EX,title_EX);" ');
document.write('onMouseOver=" window.status=');
document.write("'Add Fanicks Garden Center to your favorites!'; return true ");
document.write('"onMouseOut=" window.status=');
document.write("' '; return true ");
document.write('"><img id="imgfavs" alt="CLICK here to add Fanicks Garden Center to your favorites" src="images/favoritesFlat.jpg" ></a>');
}
Reply From: Likno Customer Support
Hello,
First of all, it seems that only Internet Explorer has four buttons, while all other browsers have three:
The email button would be really easy to replicate in AllWebMenus. Just create the button with the design you want and add the following as a link:
mailto:{EMAIL REMOVED}?subject=Info from Fanick's Garden Center&body=Enter your message here
The “favorite” button is not something that can work cross-browser reliably and I guess this is why you only show it in Internet Explorer.
To replicate the functionality in AllWebMenus you need to add the following code to the “Javascript command” field of your item:
window.external.AddFavorite(location.href,document.title);
Regards,
Kostas
Likno Customer Support
www.likno.com
Create any type of javascript menu (CSS menu, drop-down menu, sliding menu), button, html tree, modal window, tooltip, accordion, tab, scroller, jQuery slider or design for your websites!
Like us on Facebook – Follow us on Twitter
Reply From: User
Thank You!
Tags: browsers, button, code, css menu, drop-down menu, email, Internet Explorer, JavaScript, javascript menu, jquery, link, Menu, page, run, sliding menu, software, website