Features: mailto function with all browser chrome ,safari, ie, mozila, opera
Required: jQuery 1.7.2 java script file
Required: jQuery 1.7.2 java script file
function mailURL(url)
{
var mailto_link = 'mailto:'+'?subject='+document.title+'&body='+escape(url);
if(getBrowser()=='mozilla'){
// Mozilla FireFox Mail To Friend
// Opens a new tab but also opens up Microsoft Office window with URL
window.open(mailto_link,'emailWindow');
}
else if(getBrowser()=='ie'){
// IE Favourite
window.open(mailto_link,'emailWindow');
}
else if(getBrowser()=='opera'){
// Opera
return true;
}
else if (getBrowser()=='safari'){ // safari
window.location.href=mailto_link;
//alert('mail to safari');
}
else if(getBrowser()=='chrome'){
window.location.href=mailto_link;
//alert('mail to chrome');
}
}
function getBrowser(){
var userAgent = navigator.userAgent.toLowerCase();
$.browser.chrome = /chrome/.test(userAgent);
$.browser.safari= /webkit/.test(userAgent);
$.browser.opera=/opera/.test(userAgent);
$.browser.msie=/msie/.test( userAgent ) && !/opera/.test( userAgent );
$.browser.mozilla= /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) || /firefox/.test(userAgent);
if($.browser.chrome) return "chrome";
if($.browser.mozilla) return "mozilla";
if($.browser.opera) return "opera";
if($.browser.safari) return "safari";
if($.browser.msie) return "ie";
}